Skip to content

Commit

Permalink
use -static-libasan option
Browse files Browse the repository at this point in the history
Change-Id: I36f405edd6a8e572ed025d5d949bfc346064c963
  • Loading branch information
rdementi committed Jul 5, 2024
1 parent af0376c commit 84953ec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ if(UNIX) # LINUX, FREE_BSD, APPLE
add_subdirectory(MacMSRDriver)
include_directories("${CMAKE_SOURCE_DIR}/src/MacMSRDriver") # target_include_directories doesn't work
target_link_libraries(PCM_SHARED PRIVATE PCM_STATIC_SILENT PcmMsr Threads::Threads)
elseif(LINUX)
target_link_libraries(PCM_SHARED PRIVATE PCM_STATIC_SILENT Threads::Threads asan)
else()
target_link_libraries(PCM_SHARED PRIVATE PCM_STATIC_SILENT Threads::Threads)
endif()
Expand Down Expand Up @@ -149,6 +147,10 @@ foreach(PROJECT_NAME ${PROJECT_NAMES})
target_compile_options(${PROJECT_NAME} PRIVATE "${PCM_MSVC_RUNTIME_LIBRARY_OPTIONS}")
endif(MSVC)

if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-static-libasan")
endif()

# specific file for pcm-raw project
if(${PROJECT_NAME} STREQUAL pcm-raw)
set(LIBS ${LIBS} PCM_SIMDJSON)
Expand Down

0 comments on commit 84953ec

Please sign in to comment.