Vulkan-Tools: update to 1.3.231.1.
Enable cross-builds for vkcube, thanks @JamiKettunen
This commit is contained in:
parent
117adc7ee0
commit
a51a4f1ee6
|
@ -0,0 +1,127 @@
|
|||
From e8234991418c5b0536e342bc849d5f8ed9eb6d6f Mon Sep 17 00:00:00 2001
|
||||
From: Simon McVittie <smcv@collabora.com>
|
||||
Date: Wed, 9 Nov 2022 15:32:39 +0000
|
||||
Subject: [PATCH] build: Compile vkcube and other demos, even when
|
||||
cross-compiling
|
||||
|
||||
When building software for a non-x86 processor on an x86 build machine,
|
||||
or building 32-bit software on a 64-bit build machine, it's still useful
|
||||
to compile demo programs that can be copied into the target environment
|
||||
and run there, even if they won't necessarily be runnable on the build
|
||||
machine.
|
||||
|
||||
This also addresses a build failure when cross-compiling and attempting
|
||||
to leave the demos enabled:
|
||||
|
||||
CMake Error at cube/CMakeLists.txt:274 (install):
|
||||
install TARGETS given target "vkcube" which does not exist.
|
||||
|
||||
(and similar for the other demos)
|
||||
|
||||
Resolves: https://github.com/KhronosGroup/Vulkan-Tools/issues/592
|
||||
Signed-off-by: Simon McVittie <smcv@collabora.com>
|
||||
---
|
||||
cube/CMakeLists.txt | 76 +++++++++++++++++++++------------------------
|
||||
1 file changed, 35 insertions(+), 41 deletions(-)
|
||||
|
||||
diff --git a/cube/CMakeLists.txt b/cube/CMakeLists.txt
|
||||
index 72e0ae92b..48805b3ee 100644
|
||||
--- a/cube/CMakeLists.txt
|
||||
+++ b/cube/CMakeLists.txt
|
||||
@@ -228,21 +228,19 @@ include_directories(${CUBE_INCLUDE_DIRS})
|
||||
if(APPLE)
|
||||
include(macOS/cube/cube.cmake)
|
||||
elseif(NOT WIN32)
|
||||
- if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})
|
||||
- add_executable(vkcube
|
||||
- cube.c
|
||||
- ${PROJECT_SOURCE_DIR}/cube/cube.vert
|
||||
- ${PROJECT_SOURCE_DIR}/cube/cube.frag
|
||||
- cube.vert.inc
|
||||
- cube.frag.inc
|
||||
- ${OPTIONAL_WAYLAND_DATA_FILES})
|
||||
- target_link_libraries(vkcube Vulkan::Vulkan)
|
||||
- target_compile_definitions(vkcube PUBLIC ${CUBE_PLATFORM})
|
||||
- include(CheckLibraryExists)
|
||||
- CHECK_LIBRARY_EXISTS("rt" clock_gettime "" NEED_RT)
|
||||
- if (NEED_RT)
|
||||
- target_link_libraries(vkcube rt)
|
||||
- endif()
|
||||
+ add_executable(vkcube
|
||||
+ cube.c
|
||||
+ ${PROJECT_SOURCE_DIR}/cube/cube.vert
|
||||
+ ${PROJECT_SOURCE_DIR}/cube/cube.frag
|
||||
+ cube.vert.inc
|
||||
+ cube.frag.inc
|
||||
+ ${OPTIONAL_WAYLAND_DATA_FILES})
|
||||
+ target_link_libraries(vkcube Vulkan::Vulkan)
|
||||
+ target_compile_definitions(vkcube PUBLIC ${CUBE_PLATFORM})
|
||||
+ include(CheckLibraryExists)
|
||||
+ CHECK_LIBRARY_EXISTS("rt" clock_gettime "" NEED_RT)
|
||||
+ if (NEED_RT)
|
||||
+ target_link_libraries(vkcube rt)
|
||||
endif()
|
||||
else()
|
||||
if(CMAKE_CL_64)
|
||||
@@ -280,17 +278,15 @@ endif()
|
||||
if(APPLE)
|
||||
include(macOS/cubepp/cubepp.cmake)
|
||||
elseif(NOT WIN32)
|
||||
- if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})
|
||||
- add_executable(vkcubepp
|
||||
- cube.cpp
|
||||
- ${PROJECT_SOURCE_DIR}/cube/cube.vert
|
||||
- ${PROJECT_SOURCE_DIR}/cube/cube.frag
|
||||
- cube.vert.inc
|
||||
- cube.frag.inc
|
||||
- ${OPTIONAL_WAYLAND_DATA_FILES})
|
||||
- target_link_libraries(vkcubepp Vulkan::Vulkan)
|
||||
- target_compile_definitions(vkcubepp PUBLIC ${CUBE_PLATFORM})
|
||||
- endif()
|
||||
+ add_executable(vkcubepp
|
||||
+ cube.cpp
|
||||
+ ${PROJECT_SOURCE_DIR}/cube/cube.vert
|
||||
+ ${PROJECT_SOURCE_DIR}/cube/cube.frag
|
||||
+ cube.vert.inc
|
||||
+ cube.frag.inc
|
||||
+ ${OPTIONAL_WAYLAND_DATA_FILES})
|
||||
+ target_link_libraries(vkcubepp Vulkan::Vulkan)
|
||||
+ target_compile_definitions(vkcubepp PUBLIC ${CUBE_PLATFORM})
|
||||
else()
|
||||
if(CMAKE_CL_64)
|
||||
set(LIB_DIR "Win64")
|
||||
@@ -334,21 +330,19 @@ if(UNIX AND NOT APPLE) # i.e. Linux
|
||||
${CMAKE_CURRENT_BINARY_DIR}/xdg-decoration-code.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/xdg-decoration-client-header.h)
|
||||
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||
- if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_HOST_SYSTEM_PROCESSOR})
|
||||
- add_executable(vkcube-wayland
|
||||
- cube.c
|
||||
- ${PROJECT_SOURCE_DIR}/cube/cube.vert
|
||||
- ${PROJECT_SOURCE_DIR}/cube/cube.frag
|
||||
- cube.vert.inc
|
||||
- cube.frag.inc
|
||||
- ${OPTIONAL_WAYLAND_DATA_FILES})
|
||||
- target_link_libraries(vkcube-wayland Vulkan::Vulkan)
|
||||
- target_compile_definitions(vkcube-wayland PUBLIC VK_USE_PLATFORM_WAYLAND_KHR)
|
||||
- include(CheckLibraryExists)
|
||||
- CHECK_LIBRARY_EXISTS("rt" clock_gettime "" NEED_RT)
|
||||
- if (NEED_RT)
|
||||
- target_link_libraries(vkcube-wayland rt)
|
||||
- endif()
|
||||
+ add_executable(vkcube-wayland
|
||||
+ cube.c
|
||||
+ ${PROJECT_SOURCE_DIR}/cube/cube.vert
|
||||
+ ${PROJECT_SOURCE_DIR}/cube/cube.frag
|
||||
+ cube.vert.inc
|
||||
+ cube.frag.inc
|
||||
+ ${OPTIONAL_WAYLAND_DATA_FILES})
|
||||
+ target_link_libraries(vkcube-wayland Vulkan::Vulkan)
|
||||
+ target_compile_definitions(vkcube-wayland PUBLIC VK_USE_PLATFORM_WAYLAND_KHR)
|
||||
+ include(CheckLibraryExists)
|
||||
+ CHECK_LIBRARY_EXISTS("rt" clock_gettime "" NEED_RT)
|
||||
+ if (NEED_RT)
|
||||
+ target_link_libraries(vkcube-wayland rt)
|
||||
endif()
|
||||
install(TARGETS vkcube-wayland RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
endif()
|
|
@ -1,11 +1,12 @@
|
|||
# Template file for 'Vulkan-Tools'
|
||||
pkgname=Vulkan-Tools
|
||||
version=1.3.204.1
|
||||
version=1.3.231.1
|
||||
revision=1
|
||||
build_style=cmake
|
||||
configure_args="-DGLSLANG_INSTALL_DIR=/usr -DBUILD_CUBE=$(vopt_if cube ON OFF)
|
||||
-DVULKAN_HEADERS_INSTALL_DIR=${XBPS_CROSS_BASE}/usr -Wno-dev"
|
||||
hostmakedepends="python3 pkg-config $(vopt_if cube glslang)"
|
||||
configure_args="-DGLSLANG_INSTALL_DIR=/usr
|
||||
-DVULKAN_HEADERS_INSTALL_DIR=${XBPS_CROSS_BASE}/usr -Wno-dev
|
||||
-DWAYLAND_SCANNER_EXECUTABLE=/usr/bin/wayland-scanner"
|
||||
hostmakedepends="python3 pkg-config glslang wayland-devel"
|
||||
makedepends="Vulkan-Headers vulkan-loader libxcb-devel libxkbcommon-devel
|
||||
wayland-devel wayland-protocols libXrandr-devel"
|
||||
short_desc="Official Vulkan tools and utilities"
|
||||
|
@ -13,11 +14,4 @@ maintainer="tibequadorian <tibequadorian@posteo.de>"
|
|||
license="Apache-2.0"
|
||||
homepage="https://www.khronos.org/vulkan/"
|
||||
distfiles="https://github.com/KhronosGroup/Vulkan-Tools/archive/sdk-${version}.tar.gz"
|
||||
checksum=3242f9ad158d02af9cc44186cbd415982387356a2dd8c0492af2fdace8c22f49
|
||||
|
||||
build_options="cube"
|
||||
desc_option_cube="Build cube vulkan demo"
|
||||
|
||||
if [ -z "$CROSS_BUILD" ]; then
|
||||
build_options_default="cube"
|
||||
fi
|
||||
checksum=0388207fdc0986ed8e03092a16d76913c7189d87a0d71eff4a914942b16b552a
|
||||
|
|
Loading…
Reference in New Issue