diff options
Diffstat (limited to 'mkspecs/features')
-rw-r--r-- | mkspecs/features/default_post.prf | 13 | ||||
-rw-r--r-- | mkspecs/features/qt_common.prf | 2 | ||||
-rw-r--r-- | mkspecs/features/qt_configure.prf | 13 |
3 files changed, 26 insertions, 2 deletions
diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf index 5367b17973..ad4a5f6365 100644 --- a/mkspecs/features/default_post.prf +++ b/mkspecs/features/default_post.prf @@ -143,6 +143,19 @@ c++11|c++14|c++1z { unset(cxxstd) } +c99|c11 { + c11: cstd = C11 + else: cstd = C99 + + !isEmpty(QMAKE_CFLAGS_GNU$$cstd) { + !strict_c|isEmpty(QMAKE_CFLAGS_$$cstd): cstd = GNU$$cstd + } + + QMAKE_CFLAGS += $$eval(QMAKE_CFLAGS_$$cstd) + + unset(cstd) +} + utf8_source { QMAKE_CFLAGS += $$QMAKE_CFLAGS_UTF8_SOURCE QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_UTF8_SOURCE diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf index 93f9a2429d..638fbf38be 100644 --- a/mkspecs/features/qt_common.prf +++ b/mkspecs/features/qt_common.prf @@ -17,6 +17,8 @@ DEFINES *= QT_NO_NARROWING_CONVERSIONS_IN_CONNECT qtConfig(c++11): CONFIG += c++11 strict_c++ qtConfig(c++14): CONFIG += c++14 qtConfig(c++1z): CONFIG += c++1z +qtConfig(c99): CONFIG += c99 +qtConfig(c11): CONFIG += c11 qtConfig(stack-protector-strong): CONFIG += stack_protector_strong contains(TEMPLATE, .*lib) { # module and plugins diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 6e29eaa2b7..70c763a2c3 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -870,6 +870,15 @@ defineTest(qtConfTestPrepare_compile) { defineTest(qtConfPrepareCompileTestSource) { test_dir = $$2 + test_lang = $$eval($${1}.lang) + isEmpty(test_lang): test_lang = "c++" + + equals(test_lang, "c++"): suffix = "cpp" + else: equals(test_lang, "c"): suffix = "c" + else: equals(test_lang, "objc"): suffix = "m" + else: equals(test_lang, "objc++"): suffix = "mm" + else: error("Unknown language '$$test_lang' in compile test $$1") + # Create source code contents = "/* Generated by configure */" # Custom code before includes @@ -893,10 +902,10 @@ defineTest(qtConfPrepareCompileTestSource) { " /* END TEST */" \ " return 0;" \ "}" - write_file($$test_dir/main.cpp, contents)|error() + write_file($$test_dir/main.$$suffix, contents)|error() # Create stub .pro file - contents = "SOURCES = main.cpp" + contents = "SOURCES = main.$$suffix" # Custom project code for (ent, $$qtConfScalarOrList($${1}.qmake)): \ contents += $$ent |