diff --git a/bindings/c/CMakeLists.txt b/bindings/c/CMakeLists.txt index 9eb8da9398..8250e02a89 100644 --- a/bindings/c/CMakeLists.txt +++ b/bindings/c/CMakeLists.txt @@ -194,11 +194,7 @@ if(NOT WIN32) target_link_libraries(fdb_c_client_memory_test PRIVATE fdb_c Threads::Threads) target_include_directories(fdb_c_api_tester_impl PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/foundationdb/ ${CMAKE_SOURCE_DIR}/flow/include ${CMAKE_BINARY_DIR}/flow/include) - if(USE_SANITIZER) - target_link_libraries(fdb_c_api_tester_impl PRIVATE fdb_cpp toml11_target Threads::Threads fmt::fmt boost_asan) - else() - target_link_libraries(fdb_c_api_tester_impl PRIVATE fdb_cpp toml11_target Threads::Threads fmt::fmt boost_target) - endif() + target_link_libraries(fdb_c_api_tester_impl PRIVATE fdb_cpp toml11_target Threads::Threads fmt::fmt boost_target) target_link_libraries(fdb_c_api_tester_impl PRIVATE SimpleOpt) target_include_directories(fdb_c_unit_tests_impl PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/foundationdb/) @@ -211,11 +207,7 @@ if(NOT WIN32) # do not set RPATH for mako set_property(TARGET mako PROPERTY SKIP_BUILD_RPATH TRUE) - if (USE_SANITIZER) - target_link_libraries(mako PRIVATE fdb_c fdbclient fmt::fmt Threads::Threads fdb_cpp boost_asan rapidjson) - else() - target_link_libraries(mako PRIVATE fdb_c fdbclient fmt::fmt Threads::Threads fdb_cpp boost_target rapidjson) - endif() + target_link_libraries(mako PRIVATE fdb_c fdbclient fmt::fmt Threads::Threads fdb_cpp boost_target rapidjson) if(NOT OPEN_FOR_IDE) # Make sure that fdb_c.h is compatible with c90 @@ -439,7 +431,7 @@ if (OPEN_FOR_IDE) add_library(fdb_c_shim OBJECT fdb_c_shim.cpp) target_link_libraries(fdb_c_shim PUBLIC dl) -elseif(NOT WIN32 AND NOT APPLE AND NOT OPEN_FOR_IDE) # Linux Only +elseif(NOT WIN32 AND NOT APPLE AND NOT OPEN_FOR_IDE AND NOT USE_UBSAN) # Linux, non-ubsan only set(SHIM_LIB_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}) @@ -472,7 +464,7 @@ elseif(NOT WIN32 AND NOT APPLE AND NOT OPEN_FOR_IDE) # Linux Only --api-test-dir ${CMAKE_SOURCE_DIR}/bindings/c/test/apitester/tests ) -endif() # End Linux only +endif() # End Linux, non-ubsan only # TODO: re-enable once the old vcxproj-based build system is removed. #generate_export_header(fdb_c EXPORT_MACRO_NAME "DLLEXPORT" diff --git a/cmake/CompileBoost.cmake b/cmake/CompileBoost.cmake index 42f289e911..de5560439e 100644 --- a/cmake/CompileBoost.cmake +++ b/cmake/CompileBoost.cmake @@ -95,10 +95,10 @@ if(USE_SANITIZER) endif() message(STATUS "A sanitizer is enabled, need to build boost from source") if (USE_VALGRIND) - compile_boost(TARGET boost_asan BUILD_ARGS valgrind=on + compile_boost(TARGET boost_target BUILD_ARGS valgrind=on CXXFLAGS ${SANITIZER_COMPILE_OPTIONS} LDFLAGS ${SANITIZER_LINK_OPTIONS}) else() - compile_boost(TARGET boost_asan BUILD_ARGS context-impl=ucontext + compile_boost(TARGET boost_target BUILD_ARGS context-impl=ucontext CXXFLAGS ${SANITIZER_COMPILE_OPTIONS} LDFLAGS ${SANITIZER_LINK_OPTIONS}) endif() return() diff --git a/flow/CMakeLists.txt b/flow/CMakeLists.txt index 7b43507450..4612ae4395 100644 --- a/flow/CMakeLists.txt +++ b/flow/CMakeLists.txt @@ -66,11 +66,7 @@ foreach(ft flow flow_sampling flowlinktest) target_include_directories(${ft} SYSTEM BEFORE PUBLIC ${WOLFSSL_INCLUDE_DIR}/wolfssl) endif() target_link_libraries(${ft} PUBLIC Threads::Threads ${CMAKE_DL_LIBS}) - if(USE_SANITIZER) - target_link_libraries(${ft} PUBLIC boost_asan) - else() - target_link_libraries(${ft} PUBLIC boost_target) - endif() + target_link_libraries(${ft} PUBLIC boost_target) if(USE_VALGRIND) target_link_libraries(${ft} PUBLIC Valgrind) endif()