Resolve QMAKE_INCDIR_VULKAN on every qmake call

Do not store this variable locally, because
a) it might change if the SDK location changes
b) does not play well with Qt installer packages which would provide the
include path of the build machine.

To achieve this we introduce the (usual) magic value - for
QMAKE_EXPORT_INCDIR_VULKAN to denote "do not export this value".

Fixes: QTBUG-73796
Change-Id: Ied26ee12cbcdf7f5f6e1caef5d29dadf6309c5d6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
This commit is contained in:
Joerg Bornemann 2019-04-29 12:39:52 +02:00
parent 5d76529580
commit 6288c12bb4
4 changed files with 19 additions and 8 deletions

View File

@ -1,5 +1,2 @@
# Pick up the VULKAN_SDK env var set by the LunarG SDK so that the Vulkan
# headers are found out-of-the-box on typical Windows setups.
QMAKE_INCDIR_VULKAN = $$(VULKAN_SDK)\\include
load(windows_vulkan_sdk)
QMAKE_LIBS_VULKAN =

View File

@ -959,8 +959,10 @@ defineTest(qtConfExportLibrary) {
defines = $$eval($${spfx}.defines)
!isEmpty(defines): qtConfOutputVar(assign, $$output, QMAKE_DEFINES_$$NAME, $$defines)
includes = $$eval($${spfx}.exportincludedir)
isEmpty(includes): includes = $$eval($${spfx}.includedir)
!isEmpty(includes): qtConfOutputVar(assign, $$output, QMAKE_INCDIR_$$NAME, $$includes)
!equals(includes, -) {
isEmpty(includes): includes = $$eval($${spfx}.includedir)
!isEmpty(includes): qtConfOutputVar(assign, $$output, QMAKE_INCDIR_$$NAME, $$includes)
}
uses = $$eval($${lpfx}.dependencies)
!isEmpty(uses) {
# FIXME: ideally, we would export transitive deps only for static

View File

@ -60,8 +60,12 @@ defineReplace(qtExportLibsForModule) {
QMAKE_LIBS_$$NAME QMAKE_LIBS_$${NAME}_DEBUG QMAKE_LIBS_$${NAME}_RELEASE \
QMAKE_DEFINES_$$NAME QMAKE_INCDIR_$$NAME
for (var, vars) {
defined($$var, var): \
result += "$$var = $$val_escape($$var)"
expvar = $$var
expvar ~= s/^QMAKE_/QMAKE_EXPORT_/
defined($$expvar, var):equals($$expvar, -): next()
!defined($$expvar, var): expvar = $$var
defined($$expvar, var): \
result += "$$var = $$val_escape($$expvar)"
}
}
return($$result)

View File

@ -0,0 +1,8 @@
isEmpty(QMAKE_INCDIR_VULKAN) {
# Pick up the VULKAN_SDK env var set by the LunarG SDK so that the Vulkan
# headers are found out-of-the-box on typical Windows setups.
QMAKE_INCDIR_VULKAN = $$(VULKAN_SDK)\\include
# Do not export the include dir but resolve it on every qmake call.
QMAKE_EXPORT_INCDIR_VULKAN = -
}