summaryrefslogtreecommitdiffstats
path: root/cmake/QtSetup.cmake
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-10-17 10:14:09 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-10-17 19:23:25 +0000
commit7e7f41e40c39361059ce4693c5e3a5e1ccd6f7e5 (patch)
tree53add24af9d761f86045646d0d74ac438cc03a98 /cmake/QtSetup.cmake
parent2fa23e46c0b79a065d92a95033bfc3ae10b707cf (diff)
Pick the latest available C/C++ standard when compiling Qt
This maps the behavior of mkspecs/features/qt_common.prf and enables the use of C++17 for example in Android, where the toolchain supports it anyway. Change-Id: I41f4bdb160a3929e2fb78f36efb1ad5f2ad391a5 Reviewed-by: Qt CMake Build Bot Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'cmake/QtSetup.cmake')
-rw-r--r--cmake/QtSetup.cmake7
1 files changed, 2 insertions, 5 deletions
diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake
index 16fd9b7520..6f42e337da 100644
--- a/cmake/QtSetup.cmake
+++ b/cmake/QtSetup.cmake
@@ -24,11 +24,6 @@ elseif(APPLE)
set(CMAKE_DEBUG_POSTFIX "_debug")
endif()
-## Force C++ standard, do not fall back, do not use compiler extensions
-set(CMAKE_CXX_STANDARD 14)
-set(CMAKE_CXX_STANDARD_REQUIRED ON)
-set(CMAKE_CXX_EXTENSIONS OFF)
-
## Position independent code:
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
@@ -110,6 +105,8 @@ include(QtCompilerFlags)
## Set up non-prefix build:
qt_set_up_nonprefix_build()
+qt_set_language_standards()
+
## Find host tools (if non native):
set(QT_HOST_PATH "" CACHE PATH "Installed Qt host directory path, used for cross compiling.")