diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-12-06 17:44:59 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-07 12:55:28 +0100 |
commit | 7e66f6c207dca9f7402c4bfd27f43711c8befaac (patch) | |
tree | 9fbcde6b97e5bb373db53a72637653306dddccc7 /mkspecs | |
parent | bab5329437e6e80da7e9f30d6422ac53f4f33f6d (diff) |
Set QMAKE_*_VERSION_OVERRIDE for all modules.
On Windows, qmake searches for and uses the highest numbered available
version of each requested library, or a version with no number if no
libraries were found. This meant that qmaking a library's consumer
before qmaking the library itself could result in the consumer
incorrectly attempting to link against $${LIB}.lib rather than the
correct $${LIB}5.lib (for example).
QMAKE_$${LIB}_VERSION_OVERRIDE is the way to work around this.
Previously, a hardcoded list of libraries had version overrides set up
on Windows, but the qmake order issue affects all libraries, not just
these. Therefore, handle it for all modules.
Change-Id: I83b4646e3819f525193d1fc065b0d0e65b3be99f
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/features/qt_functions.prf | 11 | ||||
-rw-r--r-- | mkspecs/features/qt_module_config.prf | 13 |
2 files changed, 11 insertions, 13 deletions
diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 04737f5f42..65eec35bfc 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -76,6 +76,7 @@ defineTest(qtAddModule) { MODULE_INCLUDES = $$eval(QT.$${1}.includes) MODULE_LIBS = $$eval(QT.$${1}.libs) MODULE_CONFIG = $$eval(QT.$${1}.module_config) + MODULE_MAJOR_VERSION = $$eval(QT.$${1}.MAJOR_VERSION) CONFIG += $$eval(QT.$${1}.CONFIG) DEFINES += $$eval(QT.$${1}.DEFINES) @@ -119,6 +120,16 @@ defineTest(qtAddModule) { } } + win32 { + # Make sure we link against the version pulled from the module's .pri + ver_var = QMAKE_$${upper($$MODULE_NAME$$QT_LIBINFIX)}_VERSION_OVERRIDE + dver_var = QMAKE_$${upper($$MODULE_NAME$$QT_LIBINFIX)}D_VERSION_OVERRIDE + $$ver_var = $$MODULE_MAJOR_VERSION + $$dver_var = $$MODULE_MAJOR_VERSION + export($$ver_var) + export($$dver_var) + } + isEmpty(LINKAGE) { # Make sure we can link to uninstalled libraries !isEqual(MODULE_LIBS, $$[QT_INSTALL_LIBS]) { diff --git a/mkspecs/features/qt_module_config.prf b/mkspecs/features/qt_module_config.prf index 3d861279b4..6104362c0b 100644 --- a/mkspecs/features/qt_module_config.prf +++ b/mkspecs/features/qt_module_config.prf @@ -33,19 +33,6 @@ for(include_path, MODULE_INCLUDES):LAST_MODULE_INCLUDE=$${include_path} HEADERS_PRI = $$LAST_MODULE_INCLUDE/headers.pri include($$HEADERS_PRI, "", true)|clear(HEADERS_PRI) -#version overriding -win32 { - #because libnetwork.pro could be qmake'd (qmade?) before libqcore.pro we - #need to override the version of libq* in all other libq*'s just to be - #sure the same version is used - VERSIONS_LIST = $$split(VERSION, ".") - QT_LIBS_OVERRIDE = $$member(VERSIONS_LIST, 0) - for(lib, $$list(qtcore qtgui qtnetwork qtxml qtopengl qtsql qt3support)) { - eval(QMAKE_$${upper($$lib)}_VERSION_OVERRIDE = $$QT_LIBS_OVERRIDE) - eval(QMAKE_$${upper($$lib)}D_VERSION_OVERRIDE = $$QT_LIBS_OVERRIDE) - } -} - #other DESTDIR = $$eval(QT.$${MODULE}.libs) win32:!wince*:DLLDESTDIR = $$[QT_INSTALL_PREFIX]/bin |