mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-14 14:59:52 -04:00
build: fix TSAN errors from not building all code with TSAN
This commit is contained in:
parent
343c880497
commit
52b43b8e7d
@ -1089,7 +1089,8 @@ add_cpp2_thrift_library(thrift/history.thrift
|
|||||||
add_cpp2_thrift_library(thrift/features.thrift
|
add_cpp2_thrift_library(thrift/features.thrift
|
||||||
TARGET dwarfs_features_thrift OUTPUT_PATH dwarfs)
|
TARGET dwarfs_features_thrift OUTPUT_PATH dwarfs)
|
||||||
|
|
||||||
foreach(tgt dwarfs_common dwarfs_reader dwarfs_writer dwarfs_extractor dwarfs_tool
|
foreach(tgt dwarfs_common dwarfs_reader dwarfs_writer
|
||||||
|
dwarfs_extractor dwarfs_rewrite dwarfs_tool
|
||||||
${BINARY_TARGETS} ${TEST_TARGETS} ${MAIN_TARGETS})
|
${BINARY_TARGETS} ${TEST_TARGETS} ${MAIN_TARGETS})
|
||||||
set_target_properties(${tgt} PROPERTIES EXPORT_COMPILE_COMMANDS ON)
|
set_target_properties(${tgt} PROPERTIES EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
@ -1135,24 +1136,6 @@ foreach(tgt dwarfs_common dwarfs_reader dwarfs_writer dwarfs_extractor dwarfs_to
|
|||||||
|
|
||||||
add_dependencies(${tgt} dwarfs_metadata_thrift dwarfs_history_thrift)
|
add_dependencies(${tgt} dwarfs_metadata_thrift dwarfs_history_thrift)
|
||||||
|
|
||||||
if(ENABLE_ASAN)
|
|
||||||
target_compile_options(${tgt} PRIVATE -fsanitize=address
|
|
||||||
-fno-omit-frame-pointer)
|
|
||||||
target_link_options(${tgt} PRIVATE -fsanitize=address)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_TSAN)
|
|
||||||
target_compile_options(${tgt} PRIVATE -fsanitize=thread
|
|
||||||
-fno-omit-frame-pointer)
|
|
||||||
target_link_options(${tgt} PRIVATE -fsanitize=thread)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_UBSAN)
|
|
||||||
target_compile_options(${tgt} PRIVATE -fsanitize=undefined
|
|
||||||
-fno-omit-frame-pointer)
|
|
||||||
target_link_options(${tgt} PRIVATE -fsanitize=undefined)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_COVERAGE)
|
if(ENABLE_COVERAGE)
|
||||||
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
target_compile_options(${tgt} PRIVATE --coverage -fno-omit-frame-pointer)
|
target_compile_options(${tgt} PRIVATE --coverage -fno-omit-frame-pointer)
|
||||||
@ -1203,6 +1186,31 @@ target_link_libraries(
|
|||||||
dwarfs_fsst
|
dwarfs_fsst
|
||||||
)
|
)
|
||||||
|
|
||||||
|
foreach(tgt dwarfs_common dwarfs_reader dwarfs_writer dwarfs_tool
|
||||||
|
dwarfs_extractor dwarfs_rewrite dwarfs_fsst dwarfs_test_helpers
|
||||||
|
dwarfs_folly_lite dwarfs_thrift_lite dwarfs_follybenchmark_lite
|
||||||
|
dwarfs_compression_thrift dwarfs_metadata_thrift
|
||||||
|
dwarfs_history_thrift dwarfs_features_thrift
|
||||||
|
${BINARY_TARGETS} ${TEST_TARGETS} ${MAIN_TARGETS})
|
||||||
|
if(ENABLE_ASAN)
|
||||||
|
target_compile_options(${tgt} PRIVATE -fsanitize=address
|
||||||
|
-fno-omit-frame-pointer)
|
||||||
|
target_link_options(${tgt} PRIVATE -fsanitize=address)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_TSAN)
|
||||||
|
target_compile_options(${tgt} PRIVATE -fsanitize=thread
|
||||||
|
-fno-omit-frame-pointer)
|
||||||
|
target_link_options(${tgt} PRIVATE -fsanitize=thread)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(ENABLE_UBSAN)
|
||||||
|
target_compile_options(${tgt} PRIVATE -fsanitize=undefined
|
||||||
|
-fno-omit-frame-pointer)
|
||||||
|
target_link_options(${tgt} PRIVATE -fsanitize=undefined)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
# if(LIBMAGIC_FOUND)
|
# if(LIBMAGIC_FOUND)
|
||||||
# target_link_libraries(dwarfs PkgConfig::LIBMAGIC)
|
# target_link_libraries(dwarfs PkgConfig::LIBMAGIC)
|
||||||
# endif()
|
# endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user