X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=cmake%2FQuasselCompileSettings.cmake;h=b499a18f0a937b66fc41ab930efa03c81e336a93;hp=b2977b30fa4475623d7f7a4d87c5a5a441687220;hb=7a8ea3eee1dcff4eaa5398d1cf5739fa32eccd9e;hpb=0e90714cf09b52c1f4c1990895477017a05d4075 diff --git a/cmake/QuasselCompileSettings.cmake b/cmake/QuasselCompileSettings.cmake index b2977b30..b499a18f 100644 --- a/cmake/QuasselCompileSettings.cmake +++ b/cmake/QuasselCompileSettings.cmake @@ -52,7 +52,7 @@ if (CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-function -Wno-undef -fno-strict-aliasing") # ... and for Clang -elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") +elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.3") message(FATAL_ERROR "Your compiler is too old; you need Clang 3.3+, GCC 4.8+, MSVC 19.0+, or any other compiler with full C++11 support.") endif() @@ -66,12 +66,15 @@ elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-function -Wno-undef -fno-strict-aliasing") -# For MSVC, at least do a version sanity check -elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC") +# For MSVC, at least do a version sanity check... +elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.0") message(FATAL_ERROR "Your compiler is too old; you need at least Visual Studio 2015 (MSVC 19.0+), GCC 4.8+, Clang 3.3+, or any other compiler with full C++11 support.") endif() + # ... and enable exception handling (required for STL types) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") + # Unknown/unsupported compiler else() message(WARNING "Unknown or unsupported compiler. Make sure to enable C++11 support. Good luck.") @@ -80,6 +83,5 @@ endif() # Mac build stuff if (APPLE AND DEPLOY) set(CMAKE_OSX_ARCHITECTURES "x86_64") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.8") - set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.9 -stdlib=libc++") endif()