Fix Mac Deploy scripts for newer Xcode and git
[quassel.git] / cmake / QuasselCompileSettings.cmake
index f906de5..1e9646a 100644 (file)
@@ -30,21 +30,19 @@ endif()
 
 # Enable various flags on gcc
 if (CMAKE_COMPILER_IS_GNUCXX)
-    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7")
-        message(WARNING "Your compiler is too old; we expect at least GCC 4.7. Your build will likely fail.")
+    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8")
+        message(FATAL_ERROR "Your compiler is too old; you need GCC 4.8+, Clang 3.3+, MSVC 19.0+, or any other compiler with full C++11 support.")
     endif()
 
     # Let's just hope that all gccs support these options and skip the tests...
     # -fno-strict-aliasing is needed apparently for Qt < 4.6
-    set(CMAKE_CXX_FLAGS                  "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -Wnon-virtual-dtor -fno-strict-aliasing")
+    set(CMAKE_CXX_FLAGS                  "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -Wnon-virtual-dtor -fno-strict-aliasing -Wundef -Wcast-align -Wpointer-arith -Wformat-security -fno-check-new -fno-common")
     #  set(CMAKE_CXX_FLAGS_RELEASE          "-O2")   # use CMake default
     #  set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O2")  # use CMake default
     set(CMAKE_CXX_FLAGS_DEBUG             "-g -ggdb -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline")
     set(CMAKE_CXX_FLAGS_DEBUGFULL         "-g3 -ggdb -fno-inline")
     set(CMAKE_CXX_FLAGS_PROFILE           "-g3 -ggdb -fno-inline -ftest-coverage -fprofile-arcs")
 
-    set(CMAKE_CXX_FLAGS                  "${CMAKE_CXX_FLAGS} -ansi -W -Wall -Wextra -Wnon-virtual-dtor -fno-strict-aliasing -Wundef -Wcast-align -Wpointer-arith -Wformat-security -fno-check-new -fno-common")
-
     check_cxx_compiler_flag(-Woverloaded-virtual CXX_W_OVERLOADED_VIRTUAL)
     if(CXX_W_OVERLOADED_VIRTUAL)
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Woverloaded-virtual")
@@ -55,8 +53,8 @@ if (CMAKE_COMPILER_IS_GNUCXX)
 
 # ... and for Clang
 elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
-    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.1")
-        message(WARNING "Your compiler is too old; we expect at least Clang 3.1. Your build will likely fail.")
+    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()
 
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wextra -Wpointer-arith -Wformat-security -Woverloaded-virtual -fno-common -Wno-deprecated-register")
@@ -70,8 +68,8 @@ elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
 
 # For MSVC, at least do a version sanity check
 elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
-    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "18.0")
-        message(WARNING "Your compiler is too old; we expect at least Visual Studio Nov 2013 CTP (MSVC 18). Your build will likely fail.")
+    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()
 
 # Unknown/unsupported compiler
@@ -82,6 +80,6 @@ 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")
+    set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk")
 endif()