Skip to content

Commit bde099d

Browse files
committed
Set EXAMPLE_USE_SANITIZER as a CMake cache option
Easier to find/use sanitizers with the examples.
1 parent f86c35d commit bde099d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

example/all/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,18 @@ enable_testing()
3535
# Sanitizers
3636
include(sanitizers)
3737

38-
set_sanitizer_options(address DEFAULT)
38+
set_sanitizer_options(address DEFAULT -fsanitize-address-use-after-scope)
3939
set_sanitizer_options(leak DEFAULT)
4040
set_sanitizer_options(memory DEFAULT)
4141
set_sanitizer_options(memorywithorigins DEFAULT SANITIZER memory
4242
-fsanitize-memory-track-origins)
4343
set_sanitizer_options(undefined DEFAULT)
4444
set_sanitizer_options(thread DEFAULT)
4545

46+
set(EXAMPLE_USE_SANITIZER
47+
""
48+
CACHE STRING "Sanitizer to use with examples")
49+
4650
if(EXAMPLE_USE_SANITIZER)
4751
add_sanitizer_support(${EXAMPLE_USE_SANITIZER})
4852
endif()

0 commit comments

Comments
 (0)