summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mkspecs/common/gcc-base.conf1
-rw-r--r--mkspecs/common/msvc-version.conf1
-rw-r--r--mkspecs/features/default_post.prf3
-rw-r--r--qmake/doc/src/qmake-manual.qdoc5
4 files changed, 9 insertions, 1 deletions
diff --git a/mkspecs/common/gcc-base.conf b/mkspecs/common/gcc-base.conf
index 9942089ed5..1c27f34441 100644
--- a/mkspecs/common/gcc-base.conf
+++ b/mkspecs/common/gcc-base.conf
@@ -86,6 +86,7 @@ QMAKE_LFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG -fuse-linker-plugin
QMAKE_CFLAGS_C99 = -std=c99
QMAKE_CFLAGS_C11 = -std=c11
+QMAKE_CFLAGS_C17 = -std=c17
QMAKE_CFLAGS_SSE2 += -msse2
QMAKE_CFLAGS_SSE3 += -msse3
diff --git a/mkspecs/common/msvc-version.conf b/mkspecs/common/msvc-version.conf
index d9f38dae67..b3689dec41 100644
--- a/mkspecs/common/msvc-version.conf
+++ b/mkspecs/common/msvc-version.conf
@@ -121,6 +121,7 @@ greaterThan(QMAKE_MSC_VER, 1927) {
# Visual Studio 2019 (16.8 or 16.9) / Visual C++ 19.28 and up
MSVC_VER = 16.8
QMAKE_CFLAGS_C11 = /std:c11
+ QMAKE_CFLAGS_C17 = /std:c17
}
!isEmpty(COMPAT_MKSPEC):!$$COMPAT_MKSPEC: CONFIG += $$COMPAT_MKSPEC
diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf
index b2985fe89c..18f8b8ad9a 100644
--- a/mkspecs/features/default_post.prf
+++ b/mkspecs/features/default_post.prf
@@ -153,7 +153,8 @@ c++1z|c++2a {
unset(cxxstd)
}
-c99|c11 {
+c99|c11|c17|c18 {
+ c17|c18: cstd = C17
c11: cstd = C11
else: cstd = C99
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index 07a0246124..7126cfcec0 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -1208,6 +1208,11 @@
\row \li c11 \li C11 support is enabled. This option has no effect if
the compiler does not support C11, or can't select the C standard.
By default, the compiler default is used.
+ \row \li c17 \li C17, also known as C18, support is enabled.
+ This option has no effect if the compiler does not support C17, or
+ can't select the C standard.
+ By default, the compiler default is used.
+ \row \li c18 \li This is an alias for the \c{c17} value.
\row \li strict_c \li Disables support for C compiler extensions.
By default, they are enabled.
\row \li c++11 \li C++11 support is enabled. This option has no effect if