diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-09-30 20:53:53 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@qt.io> | 2016-10-15 18:45:10 +0000 |
commit | 9a088e78690a3052f9c2d7e388e37957c2470ab1 (patch) | |
tree | c49c2c62ac517ad28265257797b195275b7a9cee /mkspecs/features/qt_helper_lib.prf | |
parent | 81755e96230753fc70cecf3c6be28237015cdf9b (diff) |
use helper libs via QMAKE_USE
for that, qt_help_lib.prf gains the ability to write "external module
pri" files that contain suitable information for QMAKE_USE.
these files have a bunch of limitations:
- they are not installed, because a) they are not relocatable and b) the
helper libs' headers are not installed, either
- it won't work with qmake -r, which is ok, as qt5 does not build with
qmake -r anyway
- deps are not transitive, neither at build nor at use time
the freetype, harfbuzz-ng, pcre, and png helper libs have been adjusted
accordingly, and their uses replaced with QMAKE_USE instances. this also
allowed inlining the now trivial {harfbuzz,pcrc,png}_dependency.pri
files. freetype_dependency.pri remains due to its funkiness.
Change-Id: I16890eecb122e34ec49f3d3e68380d1ea71a198a
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'mkspecs/features/qt_helper_lib.prf')
-rw-r--r-- | mkspecs/features/qt_helper_lib.prf | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/mkspecs/features/qt_helper_lib.prf b/mkspecs/features/qt_helper_lib.prf index 8890866c64..f0072f82db 100644 --- a/mkspecs/features/qt_helper_lib.prf +++ b/mkspecs/features/qt_helper_lib.prf @@ -15,6 +15,9 @@ TEMPLATE = lib CONFIG -= qt QT = # In case qt is re-added. +INCLUDEPATH += $$MODULE_INCLUDEPATH +DEFINES += $$MODULE_DEFINES + CONFIG -= warning_clean # Don't presume 3rd party code to be clean load(qt_common) @@ -25,6 +28,28 @@ qtConfig(build_all): CONFIG += build_all DESTDIR = $$MODULE_BASE_OUTDIR/lib DLLDESTDIR = $$MODULE_BASE_OUTDIR/bin +!build_pass { + MODULE = $$replace(TARGET, ^qt, ) + MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_ext_$${MODULE}.pri + ucmodule = $$upper($$MODULE) + + MODULE_PRI_CONT = \ + "QMAKE_INCDIR_$${ucmodule} = $$val_escape(MODULE_INCLUDEPATH)" \ + "QMAKE_DEFINES_$${ucmodule} = $$val_escape(MODULE_DEFINES)" + MODULE_LIBS = -L$$DESTDIR -l$$TARGET + debug_and_release { + win32: MODULE_DEBUG_LIBS = -L$$DESTDIR -l$${TARGET}d + darwin: MODULE_DEBUG_LIBS = -L$$DESTDIR -l$${TARGET}_debug + MODULE_PRI_CONT += \ + "QMAKE_LIBS_$${ucmodule}_DEBUG = $$val_escape(MODULE_DEBUG_LIBS)" \ + "QMAKE_LIBS_$${ucmodule}_RELEASE = $$val_escape(MODULE_LIBS)" + } else { + MODULE_PRI_CONT += \ + "QMAKE_LIBS_$${ucmodule} = $$val_escape(MODULE_LIBS)" + } + write_file($$MODULE_PRI, MODULE_PRI_CONT)|error() +} + # In static builds of Qt, convenience libraries must be installed, # as in this case they are not linked to the final library/plugin. installed|if(!not_installed:qtConfig(static)): load(qt_installs) |