diff options
author | Robin Burchell <robin.burchell@collabora.co.uk> | 2011-01-17 12:31:45 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-01-17 12:31:45 (GMT) |
commit | 145c6bdef2680ca0da07f8f0cf09419edf9ecd52 (patch) | |
tree | 43c948eae97d282a1320d58815f21ddb13f11c88 /mkspecs | |
parent | a13e97b42c89159667f2d89c7eda2dbfdf1465e8 (diff) | |
download | Qt-145c6bdef2680ca0da07f8f0cf09419edf9ecd52.zip Qt-145c6bdef2680ca0da07f8f0cf09419edf9ecd52.tar.gz Qt-145c6bdef2680ca0da07f8f0cf09419edf9ecd52.tar.bz2 |
Use packagesExist() macro to bail if a nonexistant package is requested.
This will solve problematic cases with large projects, lots of required
packages, and no configure scripts failing to build partway through. Previously,
PKGCONFIG processing would error to stdout, but continue the compilation.
This should not affect existing code overly much, apart from projects who added
nonexistent packages they didn't use to PKGCONFIG (but let's face it, that's a
bit of a stupid thing to do.)
Task-number: QTBUG-11418
Merge-request: 1022
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'mkspecs')
-rw-r--r-- | mkspecs/features/link_pkgconfig.prf | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mkspecs/features/link_pkgconfig.prf b/mkspecs/features/link_pkgconfig.prf index b1b00e43..a3dbd1f 100644 --- a/mkspecs/features/link_pkgconfig.prf +++ b/mkspecs/features/link_pkgconfig.prf @@ -2,7 +2,11 @@ isEmpty(PKG_CONFIG):PKG_CONFIG = pkg-config # keep consistent with qt_functions.prf too! for(PKGCONFIG_LIB, $$list($$unique(PKGCONFIG))) { + # don't proceed if the .pro asks for a package we don't have! + !packagesExist($$PKGCONFIG_LIB):error("Package $$PKGCONFIG_LIB not found") + QMAKE_CXXFLAGS += $$system($$PKG_CONFIG --cflags $$PKGCONFIG_LIB) QMAKE_CFLAGS += $$system($$PKG_CONFIG --cflags $$PKGCONFIG_LIB) LIBS += $$system($$PKG_CONFIG --libs $$PKGCONFIG_LIB) } + |