build: Cross-compile Vulkan Loader with Vulkan and SPIRV Headers.

This commit is contained in:
Rémi Bernon 2021-11-12 13:36:32 +01:00 committed by Arkadiusz Hiler
parent 778d6a4e43
commit 68877059b1
2 changed files with 26 additions and 7 deletions

View file

@ -575,8 +575,8 @@ $(eval $(call rules-cmake,jxrlib,64))
## ##
$(eval $(call rules-source,vulkan-headers,$(SRCDIR)/Vulkan-Headers)) $(eval $(call rules-source,vulkan-headers,$(SRCDIR)/Vulkan-Headers))
$(eval $(call rules-cmake,vulkan-headers,32)) $(eval $(call rules-cmake,vulkan-headers,32,CROSS))
$(eval $(call rules-cmake,vulkan-headers,64)) $(eval $(call rules-cmake,vulkan-headers,64,CROSS))
## ##
@ -584,8 +584,23 @@ $(eval $(call rules-cmake,vulkan-headers,64))
## ##
$(eval $(call rules-source,spirv-headers,$(SRCDIR)/SPIRV-Headers)) $(eval $(call rules-source,spirv-headers,$(SRCDIR)/SPIRV-Headers))
$(eval $(call rules-cmake,spirv-headers,32)) $(eval $(call rules-cmake,spirv-headers,32,CROSS))
$(eval $(call rules-cmake,spirv-headers,64)) $(eval $(call rules-cmake,spirv-headers,64,CROSS))
##
## Vulkan-Loader
##
VULKAN_LOADER_CMAKE_ARGS = -DUSE_MASM=OFF
VULKAN_LOADER_CMAKE_ARGS64 = -DVULKAN_HEADERS_INSTALL_DIR=$(VULKAN_HEADERS_DST64)
VULKAN_LOADER_CMAKE_ARGS32 = -DVULKAN_HEADERS_INSTALL_DIR=$(VULKAN_HEADERS_DST32)
VULKAN_LOADER_CFLAGS = -DWINVER=0x0A00 -D_WIN32_WINNT=0x0A00 # 0x0A00 is _WIN32_WINNT_WIN10
VULKAN_LOADER_DEPENDS = vulkan-headers spirv-headers
$(eval $(call rules-source,vulkan-loader,$(SRCDIR)/Vulkan-Loader))
$(eval $(call rules-cmake,vulkan-loader,32,CROSS))
$(eval $(call rules-cmake,vulkan-loader,64,CROSS))
## ##
@ -805,7 +820,7 @@ VKD3D_LDFLAGS = -static-libgcc $(CROSSLDFLAGS)
VKD3D_LDFLAGS32 = -L$(WINE_OBJ32)/dlls/vulkan-1/ VKD3D_LDFLAGS32 = -L$(WINE_OBJ32)/dlls/vulkan-1/
VKD3D_LDFLAGS64 = -L$(WINE_OBJ64)/dlls/vulkan-1/ VKD3D_LDFLAGS64 = -L$(WINE_OBJ64)/dlls/vulkan-1/
VKD3D_DEPENDS = wine vulkan-headers spirv-headers VKD3D_DEPENDS = wine vulkan-loader vulkan-headers spirv-headers
$(eval $(call rules-source,vkd3d,$(SRCDIR)/vkd3d)) $(eval $(call rules-source,vkd3d,$(SRCDIR)/vkd3d))
$(eval $(call rules-autoconf,vkd3d,32,CROSS)) $(eval $(call rules-autoconf,vkd3d,32,CROSS))

View file

@ -2,9 +2,10 @@
# $(1): lowercase package name # $(1): lowercase package name
# $(2): uppercase package name # $(2): uppercase package name
# $(3): 32/64, build type # $(3): 32/64, build type
# $(4): CROSS/<empty>, cross compile
# #
define create-rules-cmake define create-rules-cmake
$(call create-rules-common,$(1),$(2),$(3)) $(call create-rules-common,$(1),$(2),$(3),$(4))
ifeq ($(CONTAINER),1) ifeq ($(CONTAINER),1)
$$(OBJ)/.$(1)-configure$(3): $$($(2)_SRC)/CMakeLists.txt $$(OBJ)/.$(1)-configure$(3): $$($(2)_SRC)/CMakeLists.txt
@ -16,6 +17,9 @@ $$(OBJ)/.$(1)-configure$(3): $$($(2)_SRC)/CMakeLists.txt
-DCMAKE_INSTALL_PREFIX="$$($(2)_DST$(3))" \ -DCMAKE_INSTALL_PREFIX="$$($(2)_DST$(3))" \
-DCMAKE_INSTALL_LIBDIR="lib$(subst 32,,$(3))" \ -DCMAKE_INSTALL_LIBDIR="lib$(subst 32,,$(3))" \
-DCMAKE_BUILD_TYPE=plain \ -DCMAKE_BUILD_TYPE=plain \
-DCMAKE_SYSTEM_NAME=$(if $(4),Windows,Linux) \
-DCMAKE_SHARED_LIBRARY_PREFIX_C=$(if $(4),,lib) \
-DCMAKE_IMPORT_LIBRARY_PREFIX_C=$(if $(4),,lib) \
$$($(2)_CMAKE_ARGS) \ $$($(2)_CMAKE_ARGS) \
$$($(2)_CMAKE_ARGS$(3)) $$($(2)_CMAKE_ARGS$(3))
@ -31,4 +35,4 @@ $$(OBJ)/.$(1)-build$(3):
endif endif
endef endef
rules-cmake = $(call create-rules-cmake,$(1),$(call toupper,$(1)),$(2)) rules-cmake = $(call create-rules-cmake,$(1),$(call toupper,$(1)),$(2),$(3))