aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/CMakeLists.txt
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2017-07-25 17:32:25 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2017-07-26 06:42:01 +0000
commitceaf538ec5b502737ed1f113aea819ff72bbe21d (patch)
treef1d3fead1195783b2f041394521575452f5c0d6c /sources/shiboken2/CMakeLists.txt
parent0f23b429561931e5fab2237d57d913fe56f44aac (diff)
Force usage of C++11 for shiboken
Previously we requested C++11 support from the compiler, but if the compiler does not support the standard, CMake would silently fall back to using C++08. Force usage of C++11, and cancel the build if the standard is not supported. Change-Id: I963a3f3d0b7dffb85a822c7aeb5f6979c0bbc189 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken2/CMakeLists.txt')
-rw-r--r--sources/shiboken2/CMakeLists.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/sources/shiboken2/CMakeLists.txt b/sources/shiboken2/CMakeLists.txt
index 0d58bcd64..56107a8d6 100644
--- a/sources/shiboken2/CMakeLists.txt
+++ b/sources/shiboken2/CMakeLists.txt
@@ -188,7 +188,11 @@ else()
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D QT_NO_CAST_FROM_ASCII -D QT_NO_CAST_TO_ASCII")
+
+# Force usage of the C++11 standard, without a silent fallback
+# to C++98 if the compiler does not support C++11.
set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE)