Changeset View
Changeset View
Standalone View
Standalone View
modules/ECMEnableSanitizers.cmake
Show First 20 Lines • Show All 159 Lines • ▼ Show 20 Line(s) | 155 | foreach ( CUR_SANITIZER ${ECM_ENABLE_SANITIZERS} ) | |||
---|---|---|---|---|---|
160 | # TODO: GCC will not link pthread library if enabled ASan | 160 | # TODO: GCC will not link pthread library if enabled ASan | ||
161 | if(CMAKE_C_COMPILER_ID MATCHES "Clang") | 161 | if(CMAKE_C_COMPILER_ID MATCHES "Clang") | ||
162 | set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${XSAN_COMPILE_FLAGS}" ) | 162 | set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${XSAN_COMPILE_FLAGS}" ) | ||
163 | endif() | 163 | endif() | ||
164 | set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${XSAN_COMPILE_FLAGS}" ) | 164 | set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${XSAN_COMPILE_FLAGS}" ) | ||
165 | if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") | 165 | if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") | ||
166 | link_libraries(${XSAN_LINKER_FLAGS}) | 166 | link_libraries(${XSAN_LINKER_FLAGS}) | ||
167 | endif() | 167 | endif() | ||
168 | if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") | 168 | if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
169 | string(REPLACE "-Wl,--no-undefined" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}") | 169 | string(REPLACE "-Wl,--no-undefined" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}") | ||
170 | string(REPLACE "-Wl,--no-undefined" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}") | 170 | string(REPLACE "-Wl,--no-undefined" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}") | ||
171 | endif () | 171 | endif () | ||
172 | endforeach() | 172 | endforeach() | ||
173 | else() | 173 | else() | ||
174 | message(STATUS "Tried to enable sanitizers (-DECM_ENABLE_SANITIZERS=${ECM_ENABLE_SANITIZERS}), \ | 174 | message(STATUS "Tried to enable sanitizers (-DECM_ENABLE_SANITIZERS=${ECM_ENABLE_SANITIZERS}), \ | ||
175 | but compiler (${CMAKE_CXX_COMPILER_ID}) does not have sanitizer support") | 175 | but compiler (${CMAKE_CXX_COMPILER_ID}) does not have sanitizer support") | ||
176 | endif() | 176 | endif() | ||
177 | endif() | 177 | endif() |