qt5base-lts/mkspecs/features/qmake_use.prf
Thiago Macieira 310bf3f57c Make sure flags from library detections go to the right places
Split them and add -I flags to INCLUDEPATH and -D flags to
DEFINES. Anything else gets reported as a problem and dropped.

This has the benefit that qmake will automatically use -isystem for
those paths if they lie in a system directory. As a consequence of that,
we won't get any warnings in headers located there. There are multiple
cases of glib, gtk, etc. headers producing warnings (such as enums
ending in comma). This does not fix warnings produced by use of macros
declared in system headers, though...

Done-with: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Change-Id: I4b844cb518dbae5ea499811221f9015af985110a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-10-10 16:59:10 +00:00

29 lines
842 B
Plaintext

suffix =
for(ever) {
QMAKE_USE$${suffix} = $$unique(QMAKE_USE$${suffix})
for (use, QMAKE_USE$${suffix}) {
use = $$split(use, /)
name = $$take_first(use)
nu = $$upper($$name)
debug: \
libs = $$eval(QMAKE_LIBS_$${nu}_DEBUG)
else: \
libs = $$eval(QMAKE_LIBS_$${nu}_RELEASE)
libs += $$eval(QMAKE_LIBS_$$nu)
defines = $$eval(QMAKE_DEFINES_$${nu})
includes = $$eval(QMAKE_INCDIR_$${nu})
isEmpty(libs):isEmpty(defines):isEmpty(includes): \
error("Library '$$name' is not defined.")
!contains(use, nolink): \
LIBS$${suffix} += $$libs
!contains(use, linkonly) {
DEFINES += $$defines
INCLUDEPATH += $$includes
}
}
!isEmpty(suffix): break()
suffix = "_PRIVATE"
}