summaryrefslogtreecommitdiffstats
path: root/configure.json
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-02-14 13:40:57 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-03-21 13:52:10 +0000
commita47cb146809e32f43449dcfe9932833c2f0ab987 (patch)
treeeea6a33781db5aa4aa303c04b77ca66734e8c78a /configure.json
parent5f66486cc254e1483f776d3058f96db493fd26e5 (diff)
Detect C standard and try using the most recent
Fixes the default C version used with gcc < 5 Change-Id: I948dece961caed8e6b181e1c6e6b9dc43c46583f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'configure.json')
-rw-r--r--configure.json48
1 files changed, 48 insertions, 0 deletions
diff --git a/configure.json b/configure.json
index ae2aa22070..b4d763116c 100644
--- a/configure.json
+++ b/configure.json
@@ -259,6 +259,36 @@
"type": "compile",
"test": "stl"
},
+ "c99": {
+ "label": "C99 support",
+ "type": "compile",
+ "test": {
+ "head": [
+ "#if __STDC_VERSION__ >= 199901L",
+ "// Compiler claims to support C99, trust it",
+ "#else",
+ "# error __STDC_VERSION__ must be >= 199901L",
+ "#endif"
+ ],
+ "lang": "c",
+ "qmake": "CONFIG += c99"
+ }
+ },
+ "c11": {
+ "label": "C11 support",
+ "type": "compile",
+ "test": {
+ "head": [
+ "#if __STDC_VERSION__ >= 201112L",
+ "// Compiler claims to support C11, trust it",
+ "#else",
+ "# error __STDC_VERSION__ must be >= 201112L",
+ "#endif"
+ ],
+ "lang": "c",
+ "qmake": "CONFIG += c11"
+ }
+ },
"c++14": {
"label": "C++14 support",
"type": "compile",
@@ -786,6 +816,19 @@
"condition": "features.c++14 && tests.c++1z",
"output": [ "publicFeature", "publicQtConfig" ]
},
+ "c89": {
+ "label": "C89"
+ },
+ "c99": {
+ "label": "C99",
+ "condition": "tests.c99",
+ "output": [ "publicFeature" ]
+ },
+ "c11": {
+ "label": "C11",
+ "condition": "features.c99 && tests.c11",
+ "output": [ "publicFeature" ]
+ },
"precompile_header": {
"label": "Using precompiled headers",
"condition": "config.msvc || tests.precompile_header",
@@ -1247,6 +1290,11 @@ Configure with '-qreal float' to create a build that is binary-compatible with 5
},
"shared",
{
+ "message": "Using C standard",
+ "type": "firstAvailableFeature",
+ "args": "c11 c99 c89"
+ },
+ {
"message": "Using C++ standard",
"type": "firstAvailableFeature",
"args": "c++1z c++14 c++11"