Commit 927b758b authored by Milian Wolff's avatar Milian Wolff
Browse files

Explicitly disable sanitizers for debuggees

I often just set CMAKE_CXX_DEBUG_FLAGS to contain
`-fsanitize=address,undefined` which would then influence the
observed behavior of the debuggees in test_gdb and lead to
failed tests.

Instead, explicitly disable the sanitizers to make sure we don't
run into this corner case.
parent d9782419
......@@ -9,7 +9,9 @@ function(add_debuggable_executable target)
# COMPILE_FLAGS_DEBUG should already have the desired flags
set_target_properties(${target} PROPERTIES COMPILE_FLAGS_RELEASE "/DEBUG /Od")
else()
set_target_properties(${target} PROPERTIES COMPILE_FLAGS "${CMAKE_CXX_FLAGS_DEBUG} -O0")
# explicitly disable sanitizers, in case they got enabled globally
set_target_properties(${target} PROPERTIES COMPILE_FLAGS "-g -O0 -fno-sanitize=address,undefined")
set_target_properties(${target} PROPERTIES LINK_FLAGS "-g -O0 -fno-sanitize=address,undefined")
endif()
set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
endfunction()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment