From dd5aea940217cbfa3e61a8ec9e9671eab23bc490 Mon Sep 17 00:00:00 2001 From: Hans Dembinski <hans.dembinski@gmail.com> Date: Wed, 24 Apr 2019 16:20:18 +0200 Subject: [PATCH] simpler --- CMakeModules/CorsikaUtilities.cmake | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CMakeModules/CorsikaUtilities.cmake b/CMakeModules/CorsikaUtilities.cmake index 1ceabe90..4b083e7a 100644 --- a/CMakeModules/CorsikaUtilities.cmake +++ b/CMakeModules/CorsikaUtilities.cmake @@ -102,11 +102,12 @@ function (CORSIKA_ADD_TEST name) target_include_directories (${name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/test_outputs/) add_test (NAME ${name} COMMAND ${name} -o ${PROJECT_BINARY_DIR}/test_outputs/junit-${name}.xml -r junit) - if(CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) - target_compile_options(${name} PRIVATE -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=all) - set_target_properties(${name} PROPERTIES LINK_FLAGS "-fsanitize=address,undefined") - else() - target_compile_options(${name} PRIVATE -fno-omit-frame-pointer -fsanitize=address,leak,undefined -fno-sanitize-recover=all) - set_target_properties(${name} PROPERTIES LINK_FLAGS "-fsanitize=address,leak,undefined") + set(sanitize "address,implicit-integer-truncation,implicit-conversion,integer,alignment,bool,builtin,bounds,enum,float-cast-overflow,function,pointer-overflow,return,shift,shift-base,shift-exponent,unreachable,vla-bound,vptr") + if(NOT CMAKE_CXX_COMPILER_ID STREQUAL AppleClang) + # Apple has some security measures which interfere with the leak sanitizer, so we can't use it on OSX + set(sanitize "leak,${sanitize}") endif() + target_compile_options(${name} PRIVATE -fno-omit-frame-pointer -fsanitize=${sanitize} -fno-sanitize-recover=all) + set_target_properties(${name} PROPERTIES LINK_FLAGS "-fsanitize=${sanitize}") + endfunction (CORSIKA_ADD_TEST) -- GitLab