Skip to content

Commit 8397227

Browse files
authored
[vulkan-sdk-components] Use separate port for the SDK (microsoft#35742)
* [vulkan-sdk] Separate port * Update ci.baseline.txt * [hikogui] Using glslc from shaderc * [vulkan] Drop LICENSE.txt * [vulkan-sdk-components] Avoid vulkan-sdk name * [vulkan] Fixup copyright text
1 parent dc19823 commit 8397227

17 files changed

+155
-60
lines changed

ports/hikogui/vcpkg.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "hikogui",
33
"version": "0.8.1",
4-
"port-version": 1,
4+
"port-version": 2,
55
"maintainers": "@takev",
66
"description": "A portable, low latency, retained-mode GUI framework written in C++.",
77
"homepage": "https://github.com/hikogui/hikogui",
@@ -14,6 +14,7 @@
1414
"tools"
1515
]
1616
},
17+
"shaderc",
1718
{
1819
"name": "vcpkg-cmake",
1920
"host": true
File renamed without changes.
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
2+
3+
set(components COMPONENTS glslang)
4+
if(VCPKG_TARGET_IS_WINDOWS)
5+
list(APPEND components dxc)
6+
endif()
7+
8+
set(vulkan_result_file "${CURRENT_BUILDTREES_DIR}/vulkan-${TARGET_TRIPLET}.cmake.log")
9+
vcpkg_cmake_configure(
10+
SOURCE_PATH "${CURRENT_INSTALLED_DIR}/share/vulkan/detect-vulkan"
11+
OPTIONS
12+
"-DVCPKG_VULKAN_VERSION=${VERSION}"
13+
"-DVCPKG_VULKAN_COMPONENTS=${components}"
14+
OPTIONS_RELEASE
15+
"-DOUTFILE=${vulkan_result_file}"
16+
)
17+
18+
include("${vulkan_result_file}")
19+
if(NOT DETECTED_Vulkan_FOUND)
20+
message(FATAL_ERROR "The Vulkan SDK wasn't found.")
21+
endif()
22+
23+
find_file(vulkan_license NAMES LICENSE.txt PATHS ${DETECTED_Vulkan_INCLUDE_DIRS} "${CURRENT_PORT_DIR}" PATH_SUFFIXES "..")
24+
vcpkg_install_copyright(FILE_LIST "${vulkan_license}")
25+
26+
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

ports/vulkan-sdk-components/usage

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
vulkan-sdk-components is compatible with built-in CMake targets:
2+
3+
# https://cmake.org/cmake/help/latest/module/FindVulkan.html
4+
find_package(Vulkan REQUIRED)
5+
# SPIR-V generator library
6+
target_link_libraries(main PRIVATE Vulkan::glslang)
7+
# DirectX Shader Compiler
8+
target_link_libraries(main PRIVATE Vulkan::dxc)
9+
10+
The vulkan-sdk-components package does not provide direct Visual Studio
11+
integration. For manual integration, add $(VULKAN_SDK)/include to your
12+
include path.
+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"$comment": "Dependencies extracted from e.g. https://sdk.lunarg.com/sdk/download/1.3.268.0/windows/config.json",
3+
"name": "vulkan-sdk-components",
4+
"version": "1.3.268.0",
5+
"description": "Installs packages which are part of the Vulkan SDK.",
6+
"license": null,
7+
"supports": "!uwp & !xbox",
8+
"dependencies": [
9+
{
10+
"name": "directx-dxc",
11+
"platform": "windows"
12+
},
13+
"glm",
14+
"glslang",
15+
"jsoncpp",
16+
{
17+
"name": "mimalloc",
18+
"platform": "windows"
19+
},
20+
"robin-hood-hashing",
21+
"sdl2",
22+
"shaderc",
23+
"spirv-cross",
24+
"spirv-headers",
25+
"valijson",
26+
{
27+
"name": "vcpkg-cmake",
28+
"host": true
29+
},
30+
"volk",
31+
"vulkan",
32+
"vulkan-memory-allocator",
33+
"vulkan-utility-libraries",
34+
"vulkan-validationlayers"
35+
],
36+
"features": {
37+
"tools": {
38+
"description": "Build Vulkan related tools",
39+
"dependencies": [
40+
"lunarg-vulkantools",
41+
"spirv-reflect",
42+
"spirv-tools",
43+
"vulkan-tools"
44+
]
45+
}
46+
}
47+
}

ports/vulkan-utility-libraries/vcpkg.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "vulkan-utility-libraries",
33
"version": "1.3.268.0",
4+
"port-version": 1,
45
"description": "Utility libraries for Vulkan developers",
56
"homepage": "https://github.com/KhronosGroup/Vulkan-Utility-Libraries",
67
"license": null,
7-
"supports": "!android",
88
"dependencies": [
99
{
1010
"name": "vcpkg-cmake",

ports/vulkan/CMakeLists.txt

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ cmake_minimum_required(VERSION 3.25)
22

33
project(FIND_VULKAN LANGUAGES C)
44

5-
set(CMAKE_FIND_DEBUG_MODE ON)
6-
7-
find_package(Vulkan ${VCPKG_VULKAN_VERSION})
5+
find_package(Vulkan ${VCPKG_VULKAN_VERSION} ${VCPKG_VULKAN_COMPONENTS})
6+
if(NOT Vulkan_FOUND)
7+
set(CMAKE_FIND_DEBUG_MODE ON)
8+
find_package(Vulkan ${VCPKG_VULKAN_VERSION} ${VCPKG_VULKAN_COMPONENTS})
9+
endif()
810

911
set(OUTFILE "${CMAKE_CURRENT_BINARY_DIR}/vulkan-result.cmake" CACHE FILEPATH "")
1012
configure_file("vulkan-result.cmake.in" "${OUTFILE}" @ONLY ESCAPE_QUOTES)

ports/vulkan/portfile.cmake

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
22

3-
43
set(vulkan_result_file "${CURRENT_BUILDTREES_DIR}/vulkan-${TARGET_TRIPLET}.cmake.log")
54
vcpkg_cmake_configure(
65
SOURCE_PATH "${CMAKE_CURRENT_LIST_DIR}"
7-
OPTIONS
8-
"-DVCPKG_VULKAN_VERSION=${VERSION}"
96
OPTIONS_RELEASE
107
"-DOUTFILE=${vulkan_result_file}"
118
)
129

1310
include("${vulkan_result_file}")
1411
if(DETECTED_Vulkan_FOUND)
15-
message(STATUS "Found Vulkan SDK ${DETECTED_Vulkan_VERSION} (${DETECTED_Vulkan_LIBRARIES})")
12+
message(STATUS "Found Vulkan ${DETECTED_Vulkan_VERSION} (${DETECTED_Vulkan_LIBRARIES})")
1613
else()
17-
set(message "The Vulkan SDK wasn't found. ")
18-
if(VCPKG_TARGET_IS_WINDOWS)
19-
string(APPEND message "Refer to Getting Started with the Windows Vulkan SDK: https://vulkan.lunarg.com/doc/sdk/latest/windows/getting_started.html")
20-
elseif(VCPKG_TARGET_IS_OSX)
21-
string(APPEND message "Refer to Getting Started with the MacOS Vulkan SDK: https://vulkan.lunarg.com/doc/sdk/latest/mac/getting_started.html")
22-
elseif(VCPKG_TARGET_IS_LINUX)
23-
string(APPEND message "Refer to Getting Started with the Linux Vulkan SDK: https://vulkan.lunarg.com/doc/sdk/latest/linux/getting_started.html")
14+
set(message "Vulkan wasn't found.")
15+
if(VCPKG_TARGET_IS_ANDROID AND DETECTED_ANDROID_NATIVE_API_LEVEL AND DETECTED_ANDROID_NATIVE_API_LEVEL LESS "24")
16+
string(APPEND message " Vulkan support from the Android NDK requires API level 24 (found: ${DETECTED_ANDROID_NATIVE_API_LEVEL})")
2417
endif()
2518
message(FATAL_ERROR "${message}")
2619
endif()
2720

28-
find_file(vulkan_license NAMES LICENSE.txt PATHS ${DETECTED_Vulkan_INCLUDE_DIRS} "${CURRENT_PORT_DIR}" PATH_SUFFIXES "..")
29-
vcpkg_install_copyright(FILE_LIST "${vulkan_license}")
21+
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt"
22+
"${CMAKE_CURRENT_LIST_DIR}/vulkan-result.cmake.in"
23+
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}/detect-vulkan"
24+
)
3025

3126
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
27+
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" [[
28+
This is a stub package. Copyright and license information
29+
is provided with Vulkan headers and loader.
30+
For Android, the loader is provided by the NDK.
31+
]])

ports/vulkan/usage

-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@ vulkan is compatible with built-in CMake targets:
33
# https://cmake.org/cmake/help/latest/module/FindVulkan.html
44
find_package(Vulkan REQUIRED)
55
target_link_libraries(main PRIVATE Vulkan::Vulkan)
6-
7-
The vulkan package does not provide direct Visual Studio integration.
8-
For manual integration, add $(VULKAN_SDK)/include to your include path.

ports/vulkan/vcpkg.json

+9-36
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,21 @@
11
{
2-
"$comment": "Dependencies extracted from e.g. https://sdk.lunarg.com/sdk/download/1.3.268.0/windows/config.json",
32
"name": "vulkan",
4-
"version": "1.3.268.0",
5-
"description": "A stub package that ensures that the Vulkan SDK is installed.",
3+
"version-date": "2023-12-17",
4+
"description": [
5+
"A stub package that ensures that Vulkan headers and a loader are available.",
6+
"On Android, the NDK provides a loader at API level 24 or higher."
7+
],
68
"license": null,
79
"supports": "!uwp & !xbox",
810
"dependencies": [
9-
{
10-
"name": "directx-dxc",
11-
"platform": "windows"
12-
},
13-
"glm",
14-
"glslang",
15-
"jsoncpp",
16-
{
17-
"name": "mimalloc",
18-
"platform": "windows"
19-
},
20-
"robin-hood-hashing",
21-
"sdl2",
22-
"shaderc",
23-
"spirv-cross",
24-
"spirv-headers",
25-
"valijson",
2611
{
2712
"name": "vcpkg-cmake",
2813
"host": true
2914
},
30-
"volk",
3115
"vulkan-headers",
32-
"vulkan-loader",
33-
"vulkan-memory-allocator",
34-
"vulkan-utility-libraries",
35-
"vulkan-validationlayers"
36-
],
37-
"features": {
38-
"tools": {
39-
"description": "Build Vulkan related tools",
40-
"dependencies": [
41-
"lunarg-vulkantools",
42-
"spirv-reflect",
43-
"spirv-tools",
44-
"vulkan-tools"
45-
]
16+
{
17+
"name": "vulkan-loader",
18+
"platform": "!android"
4619
}
47-
}
20+
]
4821
}

ports/vulkan/vulkan-result.cmake.in

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ set(DETECTED_Vulkan_FOUND "@Vulkan_FOUND@")
22
set(DETECTED_Vulkan_VERSION "@Vulkan_VERSION@")
33
set(DETECTED_Vulkan_INCLUDE_DIRS "@Vulkan_INCLUDE_DIRS@")
44
set(DETECTED_Vulkan_LIBRARIES "@Vulkan_LIBRARIES@")
5+
set(DETECTED_ANDROID_NATIVE_API_LEVEL "@ANDROID_NATIVE_API_LEVEL@")

scripts/ci.baseline.txt

+8
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,14 @@ vowpal-wabbit:x64-android=fail
11881188
vtk-m:arm-neon-android=fail
11891189
vtk-m:arm64-android=fail
11901190
vtk-m:x64-android=fail
1191+
# Needs android-24 to supply a vulkan loader library
1192+
vulkan:arm-neon-android=fail
1193+
vulkan:arm64-android=fail
1194+
vulkan:x64-android=fail
1195+
# Needs android-26
1196+
vulkan-utility-libraries:arm-neon-android=fail
1197+
vulkan-utility-libraries:arm64-android=fail
1198+
vulkan-utility-libraries:x64-android=fail
11911199
# Conflicts with latest openjpeg port (vxl ships with an old version of openjpeg)
11921200
# conflicts with qt5-location
11931201
vxl:arm-neon-android=skip

versions/baseline.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -3334,7 +3334,7 @@
33343334
},
33353335
"hikogui": {
33363336
"baseline": "0.8.1",
3337-
"port-version": 1
3337+
"port-version": 2
33383338
},
33393339
"hiredis": {
33403340
"baseline": "1.2.0",
@@ -8973,7 +8973,7 @@
89738973
"port-version": 2
89748974
},
89758975
"vulkan": {
8976-
"baseline": "1.3.268.0",
8976+
"baseline": "2023-12-17",
89778977
"port-version": 0
89788978
},
89798979
"vulkan-headers": {
@@ -8996,13 +8996,17 @@
89968996
"baseline": "3.0.1.1",
89978997
"port-version": 0
89988998
},
8999+
"vulkan-sdk-components": {
9000+
"baseline": "1.3.268.0",
9001+
"port-version": 0
9002+
},
89999003
"vulkan-tools": {
90009004
"baseline": "1.3.268.0",
90019005
"port-version": 0
90029006
},
90039007
"vulkan-utility-libraries": {
90049008
"baseline": "1.3.268.0",
9005-
"port-version": 0
9009+
"port-version": 1
90069010
},
90079011
"vulkan-validationlayers": {
90089012
"baseline": "1.3.268.0",

versions/h-/hikogui.json

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"versions": [
3+
{
4+
"git-tree": "d007fc919e0734e139f89d285000d2d166315f73",
5+
"version": "0.8.1",
6+
"port-version": 2
7+
},
38
{
49
"git-tree": "89a94b29c6cf63fb3e99c979281751279f02031e",
510
"version": "0.8.1",
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"versions": [
3+
{
4+
"git-tree": "efe1324e0d30a235687686111be4daa4605083e6",
5+
"version": "1.3.268.0",
6+
"port-version": 0
7+
}
8+
]
9+
}

versions/v-/vulkan-utility-libraries.json

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"versions": [
3+
{
4+
"git-tree": "d90089cebfde86dcb2c554b9e45271889503fc36",
5+
"version": "1.3.268.0",
6+
"port-version": 1
7+
},
38
{
49
"git-tree": "0849291de2e14ef941d30aef9a17e45547329e44",
510
"version": "1.3.268.0",

versions/v-/vulkan.json

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"versions": [
3+
{
4+
"git-tree": "3e8d64ec799440b97c7151f97dd00a53e8e1b5ea",
5+
"version-date": "2023-12-17",
6+
"port-version": 0
7+
},
38
{
49
"git-tree": "27c107c7bd16ff68d2c9da45b0020713d4b2ea03",
510
"version": "1.3.268.0",

0 commit comments

Comments
 (0)