diff options
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e34b7b..ca15a2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,16 @@ set(CMAKE_C_STANDARD 17) set(CMAKE_C_STANDARD_REQUIRED ON) set(CMAKE_C_EXTENSIONS OFF) +option(TINY_CONVMEM_ENABLE_ASAN "Enable AddressSanitizer for project and tests" OFF) +if(TINY_CONVMEM_ENABLE_ASAN) + if(NOT MSVC) + message(FATAL_ERROR "TINY_CONVMEM_ENABLE_ASAN currently supports MSVC only") + endif() + string(REPLACE "/RTC1" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") + add_compile_options(/fsanitize=address /Oy-) + add_link_options(/INCREMENTAL:NO) +endif() + include(CTest) include(cmake/mcpc.cmake) @@ -19,4 +29,3 @@ add_subdirectory(src) if(BUILD_TESTING) add_subdirectory(tests) endif() - |
