cmake: Introduce FUZZ_LIBS
CMake distinguishes recommended methods for handling (1) linker options and (2) libraries used during linking. Therefore, it is both reasonable and consistent to introduce a dedicated variable for the latter, particularly when a build environment, such as OSS-Fuzz, requires linking against additional libraries.
This commit is contained in:
1 file changed
+2
@@ -386,6 +386,7 @@ endif()
|
|||||||
target_link_options(sanitize_interface INTERFACE ${SANITIZER_LDFLAGS})
|
target_link_options(sanitize_interface INTERFACE ${SANITIZER_LDFLAGS})
|
||||||
|
|
||||||
if(BUILD_FUZZ_BINARY)
|
if(BUILD_FUZZ_BINARY)
|
||||||
|
target_link_libraries(core_interface INTERFACE ${FUZZ_LIBS})
|
||||||
include(CheckSourceCompilesWithFlags)
|
include(CheckSourceCompilesWithFlags)
|
||||||
check_cxx_source_compiles_with_flags("
|
check_cxx_source_compiles_with_flags("
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@@ -394,6 +395,7 @@ if(BUILD_FUZZ_BINARY)
|
|||||||
// No main() function.
|
// No main() function.
|
||||||
" FUZZ_BINARY_LINKS_WITHOUT_MAIN_FUNCTION
|
" FUZZ_BINARY_LINKS_WITHOUT_MAIN_FUNCTION
|
||||||
LDFLAGS ${SANITIZER_LDFLAGS}
|
LDFLAGS ${SANITIZER_LDFLAGS}
|
||||||
|
LINK_LIBRARIES ${FUZZ_LIBS}
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user