Enable -Wthread-safety for Clang and CMake. (#1403)
https://cmake.org/cmake/help/v3.2/variable/CMAKE_LANG_COMPILER_ID.htmlmaster
parent
6ad7b87b67
commit
d0348634b2
|
@ -85,6 +85,10 @@ macro(google_initialize_cartographer_project)
|
|||
google_add_flag(GOOG_CXX_FLAGS "-Werror=switch")
|
||||
google_add_flag(GOOG_CXX_FLAGS "-Werror=uninitialized")
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
|
||||
google_add_flag(GOOG_CXX_FLAGS "-Wthread-safety")
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
|
|
Loading…
Reference in New Issue