[Pkg-owncloud-commits] [qtkeychain] 19/63: Add C++11 support checking and compiler switches when building with Qt >= 5.7

Sandro Knauß hefee at debian.org
Sat Jun 10 14:39:28 UTC 2017


This is an automated email from the git hooks/post-receive script.

hefee pushed a commit to branch master
in repository qtkeychain.

commit bb6b233ef922f340f667dbd9d83c18c15c9e7474
Author: Dmitry Ivanov <dm.vl.ivanov at gmail.com>
Date:   Mon Aug 8 07:18:29 2016 +0300

    Add C++11 support checking and compiler switches when building with Qt >= 5.7
    
    Qt 5.7 is the first release of Qt which makes use of C++11 features within its own codebase, including interfaces in headers. When building something with Qt 5.7, it is required to switch the compiler to the C++11 mode
---
 CMakeLists.txt | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c298144..e1c5fb5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -66,6 +66,24 @@ if (Qt5Core_FOUND)
       set(CMAKE_POSITION_INDEPENDENT_CODE ON)
     endif()
   endif()
+
+  if (NOT Qt5Core_VERSION VERSION_LESS "5.7.0")
+    if (CMAKE_COMPILER_IS_GNUCXX)
+      if ((NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7.0") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.0"))
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+      elseif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7.0")
+        message(FATAL_ERROR "Can't build QtKeychain using g++-${CMAKE_CXX_COMPILER_VERSION} and Qt ${Qt5Core_VERSION}: compiler supporting C++11 is required")
+      endif()
+    elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+      if (NOT ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 3.3)
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+      else()
+        message(FATAL_ERROR "Can't build QtKeychain using clang++-${CMAKE_CXX_COMPILER_VERSION} and Qt ${Qt5Core_VERSION}: compiler supporting C++11 is required")
+      endif()
+    elseif ((CMAKE_CXX_COMPILER_ID MATCHES "MSVC") AND (MSVC_VERSION LESS 1700))
+      message(FATAL_ERROR "Can't build QtKeychain using VC++-${MSVC_VERSION} and Qt ${Qt5Core_VERSION}: compiler supporting C++11 is required")
+    endif()
+  endif()
 else()
   set(QTKEYCHAIN_VERSION_INFIX "")
   if(UNIX AND NOT APPLE)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/qtkeychain.git



More information about the Pkg-owncloud-commits mailing list