Commit e6565ef0 by FritzFlorian

Add AddressSanitizer Script.

parent 5bdca02f
......@@ -14,6 +14,7 @@ include(cmake/DisabelInSource.cmake)
include(cmake/SetupOptimizationLevel.cmake)
include(cmake/SetupThreadingSupport.cmake)
include(cmake/SetupThreadSanitizer.cmake)
include(cmake/SetupAddressSanitizer.cmake)
# make our internal cmake script collection avaliable in the build process.
list(APPEND CMAKE_PREFIX_PATH "${PROJECT_SOURCE_DIR}/cmake")
......
# Optionally compile with thread sanitizer enabled to find concurrency bugs
# https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual
# Add optional sanitizer, off by default
option(ADDRESS_SANITIZER "Add address sanitizer" OFF)
if(ADDRESS_SANITIZER)
add_compile_options(-fsanitize=address -fno-omit-frame-pointer -fsanitize-address-use-after-scope -g)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
endif()
message("-- Address Sanitizer: ${ADDRESS_SANITIZER}")
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 sign in to comment