make module includepath addition less convoluted
don't prepend the paths, as this will only mess up building of subsequent modules (e.g., building qtdeclarative against an installed qtbase would pick up the headers from the qtdeclarative previously installed into the same directory as qtbase). for frameworks this was a rather pointless exercise in the first place, as their headers are properly isolated anyway. however, make sure that we don't add system locations to the search paths, as this is a) unnecessary and b) messes up subsequent libraries in non-standard locations which want to shadow versions in standard locations (pkg-config .pc files which add standard paths are considered broken as well). Change-Id: Ie1dc65d4767e98e1df6e49012505141935a6c704 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
This commit is contained in:
parent
46ae5598e5
commit
5d1b4c79d2
@ -45,8 +45,12 @@ defineTest(qtAddModule) {
|
||||
CONFIG += $$eval(QT.$${1}.CONFIG)
|
||||
DEFINES += $$eval(QT.$${1}.DEFINES)
|
||||
|
||||
INCLUDEPATH -= $$MODULE_INCLUDES
|
||||
INCLUDEPATH = $$MODULE_INCLUDES $$INCLUDEPATH
|
||||
unix {
|
||||
MODULE_INCLUDES -= /usr/include /usr/local/include
|
||||
MODULE_LIBS -= /usr/lib /usr/local/lib
|
||||
}
|
||||
|
||||
INCLUDEPATH *= $$MODULE_INCLUDES
|
||||
isEqual(2, UsePrivate) { # Tests function parameter 2 ($$2) being equal to 'UsePrivate'
|
||||
# This adds both
|
||||
# <module privates include path>/
|
||||
@ -54,8 +58,7 @@ defineTest(qtAddModule) {
|
||||
# since we have code using both #include <QtCore/private/foo> and #include <private/foo>
|
||||
# Both need to be supported with the new private includes structure
|
||||
MODULE_INCLUDES_PRIVATES = $$eval(QT.$${1}.private_includes)
|
||||
INCLUDEPATH -= $$MODULE_INCLUDES_PRIVATES $$MODULE_INCLUDES_PRIVATES/$$MODULE_NAME
|
||||
INCLUDEPATH = $$MODULE_INCLUDES_PRIVATES $$MODULE_INCLUDES_PRIVATES/$$MODULE_NAME $$INCLUDEPATH
|
||||
INCLUDEPATH += $$MODULE_INCLUDES_PRIVATES $$MODULE_INCLUDES_PRIVATES/$$MODULE_NAME
|
||||
}
|
||||
|
||||
unset(LINKAGE)
|
||||
@ -63,20 +66,16 @@ defineTest(qtAddModule) {
|
||||
!contains(MODULE_CONFIG,staticlib):CONFIG(qt_framework, qt_framework|qt_no_framework) { #forced
|
||||
QMAKE_FRAMEWORKPATH *= $${MODULE_LIBS}
|
||||
FRAMEWORK_INCLUDE = $$MODULE_INCLUDES.framework/Headers
|
||||
!qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) {
|
||||
INCLUDEPATH -= $$FRAMEWORK_INCLUDE
|
||||
INCLUDEPATH = $$FRAMEWORK_INCLUDE $$INCLUDEPATH
|
||||
}
|
||||
!qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE): \
|
||||
INCLUDEPATH *= $$FRAMEWORK_INCLUDE
|
||||
LINKAGE = -framework $${MODULE_NAME}$${QT_LIBINFIX}
|
||||
} else:!qt_no_framework { #detection
|
||||
for(frmwrk_dir, $$list($$MODULE_LIBS $$QMAKE_LIBDIR $$(DYLD_FRAMEWORK_PATH) /Library/Frameworks)) {
|
||||
exists($${frmwrk_dir}/$${MODULE_NAME}.framework) {
|
||||
QMAKE_FRAMEWORKPATH *= $${frmwrk_dir}
|
||||
FRAMEWORK_INCLUDE = $$frmwrk_dir/$${MODULE_NAME}.framework/Headers
|
||||
!qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) {
|
||||
INCLUDEPATH -= $$FRAMEWORK_INCLUDE
|
||||
INCLUDEPATH = $$FRAMEWORK_INCLUDE $$INCLUDEPATH
|
||||
}
|
||||
!qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE): \
|
||||
INCLUDEPATH *= $$FRAMEWORK_INCLUDE
|
||||
LINKAGE = -framework $${MODULE_NAME}
|
||||
break()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user