Browse Source

Add support for clang sanitizer to cmake scripts.

To build with the sanitizer support use clang compiler and set CMAKE_BUILD_TYPE to "DebugSan".
More info: http://clang.llvm.org/docs/AddressSanitizer.html.
cl-refactor
Paweł Bylica 10 years ago
parent
commit
def5b507b8
  1. 2
      CMakeLists.txt

2
CMakeLists.txt

@ -10,7 +10,7 @@ else()
set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wextra -Wconversion -Wno-sign-conversion -Wno-unknown-pragmas ${CMAKE_CXX_FLAGS}")
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND NOT ${CMAKE_BUILD_TYPE} STREQUAL "DebugSan")
# Do not allow unresovled symbols in shared library (default on linux)
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
endif()

Loading…
Cancel
Save