diff options
Diffstat (limited to '')
-rw-r--r-- | CMakeLists.txt | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 70728706d..8f336e20f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,13 +44,22 @@ if(MSVC) set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} /LTCG") elseif(APPLE) #on os x clang adds pthread for us but we need to add it for gcc - if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11") + else() add_flags_cxx("-pthread") - add_flags_cxx("-std=c++11") endif() + else() # Let gcc / clang know that we're compiling a multi-threaded app: add_flags_cxx("-pthread") + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=c++11") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11") + endif() endif() |