mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
Added address sanitizer to CMakeLists
This commit is contained in:
@@ -669,10 +669,24 @@ if (COOLPROP_SNIPPETS)
|
||||
|
||||
endif()
|
||||
|
||||
if()
|
||||
if (COOLPROP_CLANG_ADDRESS_SANITIZER)
|
||||
|
||||
SET(CMAKE_CXX_FLAGS "-fsanitize=address")
|
||||
list(APPEND APP_SOURCES "${CMAKE_SOURCE_DIR}/src/Tests/test_main.cxx")
|
||||
# CATCH TEST, compile everything with catch and set test entry point
|
||||
add_executable (CatchTestRunner ${APP_SOURCES})
|
||||
add_dependencies (CatchTestRunner generate_headers)
|
||||
set_target_properties (CatchTestRunner PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -DENABLE_CATCH")
|
||||
if(UNIX)
|
||||
target_link_libraries (CatchTestRunner ${CMAKE_DL_LIBS})
|
||||
endif()
|
||||
add_custom_command(TARGET CatchTestRunner
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/CatchTestRunner)
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
if (COOLPROP_PROFILE)
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
SET(CMAKE_CXX_FLAGS "-g -O2")
|
||||
|
||||
Reference in New Issue
Block a user