From 1b5271f27f7d5c6f814567d6d3bf211b41244cc8 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 15 Dec 2016 16:20:27 +0100 Subject: determine compiler version at build time, not in configure this makes it consistent with the determination of the default include/library paths. this makes sense, as it's possible to switch the sdk/toolchain after building qt (within reason). a side effect of this change is that for compilers which emulate other compilers, both the real and the emulated version are now made available. Change-Id: Icfcc672c0d2e3d1b5e622993c366063d70ad327c Started-by: Thiago Macieira Reviewed-by: Lars Knoll --- configure.pri | 63 ----------------------------------------------------------- 1 file changed, 63 deletions(-) (limited to 'configure.pri') diff --git a/configure.pri b/configure.pri index 10eb8b287e..1744972f92 100644 --- a/configure.pri +++ b/configure.pri @@ -397,50 +397,6 @@ defineTest(qtConfTest_buildParts) { return(true) } -defineTest(qtConfTest_checkCompiler) { - contains(QMAKE_CXX, ".*clang.*") { - qtRunLoggedCommand("$$QMAKE_CXX -v 2>&1", versionstr)|return(false) - versionstr = "$$versionstr" - contains(versionstr, "^Apple (clang|LLVM) version .*") { - $${1}.compilerDescription = "Apple Clang" - $${1}.compilerId = "apple_clang" - $${1}.compilerVersion = $$replace(versionstr, "^Apple (clang|LLVM) version ([0-9.]+).*$", "\\2") - } else: contains(versionstr, ".*clang version.*") { - $${1}.compilerDescription = "Clang" - $${1}.compilerId = "clang" - $${1}.compilerVersion = $$replace(versionstr, "^.*clang version ([0-9.]+).*", "\\1") - } else { - return(false) - } - } else: contains(QMAKE_CXX, ".*g\\+\\+.*") { - qtRunLoggedCommand("$$QMAKE_CXX -dumpversion", version)|return(false) - $${1}.compilerDescription = "GCC" - $${1}.compilerId = "gcc" - $${1}.compilerVersion = $$version - } else: contains(QMAKE_CXX, ".*icpc") { - qtRunLoggedCommand("$$QMAKE_CXX -dumpversion", version)|return(false) - $${1}.compilerDescription = "ICC" - $${1}.compilerId = "icc" - $${1}.compilerVersion = $$version - } else: msvc { - command = $$QMAKE_CXX /EP /nologo $$source $$system_quote($$QMAKE_CONFIG_TESTS_DIR/win/msvc_version.cpp) - qtRunLoggedCommand("$$command", version)|return(false) - version = "$$version" - $${1}.compilerDescription = "MSVC" - $${1}.compilerId = "cl" - $${1}.compilerVersion = $$replace(version, "^.*([0-9]{2})([0-9]{2})([0-9]{5}).*$", "\\1.\\2.\\3") - } else { - return(false) - } - $${1}.compilerDescription += $$eval($${1}.compilerVersion) - export($${1}.compilerDescription) - export($${1}.compilerId) - export($${1}.compilerVersion) - $${1}.cache += compilerDescription compilerId compilerVersion - export($${1}.cache) - return(true) -} - # custom outputs # this reloads the qmakespec as completely as reasonably possible. @@ -947,25 +903,6 @@ defineTest(qtConfOutput_debugAndRelease) { } } -defineTest(qtConfOutput_compilerVersion) { - !$${2}: return() - - name = $$upper($$eval($${currentConfig}.tests.compiler.compilerId)) - version = $$eval($${currentConfig}.tests.compiler.compilerVersion) - major = $$section(version, '.', 0, 0) - minor = $$section(version, '.', 1, 1) - patch = $$section(version, '.', 2, 2) - isEmpty(minor): minor = 0 - isEmpty(patch): patch = 0 - - $${currentConfig}.output.publicPro += \ - "QT_$${name}_MAJOR_VERSION = $$major" \ - "QT_$${name}_MINOR_VERSION = $$minor" \ - "QT_$${name}_PATCH_VERSION = $$patch" - - export($${currentConfig}.output.publicPro) -} - defineTest(qtConfOutput_compilerFlags) { # this output also exports the variables locally, so that subsequent compiler tests can use them -- cgit v1.2.3