mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-12 18:44:59 +01:00
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:
parent
ea929c0848
commit
2c4b229c90
1 changed files with 2 additions and 0 deletions
|
@ -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()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue