
Previously sanitizer flags were set unconditionally for all code, including that of external libraries. Set them only for targets in src/, tests/ and exposed/. Unfortunately, the linker equivalent to add_compile_options, add_link_options, is only available for CMake version >= 3.13. So add the sanitizer flags manually to each target's linker options.
12 lines
190 B
CMake
12 lines
190 B
CMake
add_compile_options(${SANITIZE_FLAGS})
|
|
|
|
include_directories(
|
|
${CMAKE_SOURCE_DIR}/include)
|
|
|
|
add_executable(CDemo
|
|
CDemo.c)
|
|
|
|
target_link_libraries(CDemo
|
|
slvs
|
|
${SANITIZE_FLAGS})
|