mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-19 00:57:35 +02:00
Add Vulkan dependencies to VCPKG.
This commit is contained in:
parent
1264783a2f
commit
0c8b3d4b54
30 changed files with 637 additions and 32 deletions
|
@ -1,4 +1,4 @@
|
|||
Source: hifi-client-deps
|
||||
Version: 0.1
|
||||
Description: Collected dependencies for High Fidelity applications
|
||||
Build-Depends: hifi-deps, aristo (windows), glslang, liblo (windows), nlohmann-json, openvr ((linux&!arm)|windows), quazip (!android), sdl2 (!android), spirv-cross (!android), spirv-tools (!android), sranipal (windows), vulkanmemoryallocator, discord-rpc (!android)
|
||||
Build-Depends: hifi-deps, aristo (windows), glslang, liblo (windows), nlohmann-json, openvr ((linux&!arm)|windows), quazip (!android), sdl2 (!android), spirv-cross (!android), spirv-tools (!android), sranipal (windows), vulkanmemoryallocator, vulkan-headers, vulkan-validationlayers, discord-rpc (!android)
|
||||
|
|
12
cmake/ports/mimalloc/add_ref_to_page_malloc_zero.patch
Normal file
12
cmake/ports/mimalloc/add_ref_to_page_malloc_zero.patch
Normal file
|
@ -0,0 +1,12 @@
|
|||
diff --git a/src/alloc.c b/src/alloc.c
|
||||
index 86aaae75..b543e859 100644
|
||||
--- a/src/alloc.c
|
||||
+++ b/src/alloc.c
|
||||
@@ -584,6 +584,7 @@ mi_decl_nodiscard void* mi_new_reallocn(void* p, size_t newcount, size_t size) {
|
||||
#ifdef __cplusplus
|
||||
void* _mi_externs[] = {
|
||||
(void*)&_mi_page_malloc,
|
||||
+ (void*)&_mi_page_malloc_zero,
|
||||
(void*)&_mi_heap_malloc_zero,
|
||||
(void*)&_mi_heap_malloc_zero_ex,
|
||||
(void*)&mi_malloc,
|
17
cmake/ports/mimalloc/fix-cmake.patch
Normal file
17
cmake/ports/mimalloc/fix-cmake.patch
Normal file
|
@ -0,0 +1,17 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index bcfe91d8..a1e5a2b7 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -471,10 +471,10 @@ if(MI_BUILD_SHARED)
|
||||
add_custom_command(TARGET mimalloc POST_BUILD
|
||||
COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/bin/mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll" $<TARGET_FILE_DIR:mimalloc>
|
||||
COMMENT "Copy mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll to output directory")
|
||||
- install(FILES "$<TARGET_FILE_DIR:mimalloc>/mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll" DESTINATION ${mi_install_bindir})
|
||||
+ install(FILES "$<TARGET_FILE_DIR:mimalloc>/mimalloc-redirect${MIMALLOC_REDIRECT_SUFFIX}.dll" DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
endif()
|
||||
|
||||
- install(TARGETS mimalloc EXPORT mimalloc ARCHIVE DESTINATION ${mi_install_libdir} RUNTIME DESTINATION ${mi_install_bindir} LIBRARY DESTINATION ${mi_install_libdir})
|
||||
+ install(TARGETS mimalloc EXPORT mimalloc ARCHIVE DESTINATION ${mi_install_libdir} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${mi_install_libdir})
|
||||
install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir})
|
||||
endif()
|
||||
|
13
cmake/ports/mimalloc/fix-param.patch
Normal file
13
cmake/ports/mimalloc/fix-param.patch
Normal file
|
@ -0,0 +1,13 @@
|
|||
diff --git a/src/arena.c b/src/arena.c
|
||||
index 648ee84..ee55989 100644
|
||||
--- a/src/arena.c
|
||||
+++ b/src/arena.c
|
||||
@@ -794,7 +794,7 @@ bool _mi_arena_segment_clear_abandoned(mi_segment_t* segment )
|
||||
// clears the thread_id.
|
||||
void _mi_arena_segment_mark_abandoned(mi_segment_t* segment)
|
||||
{
|
||||
- mi_atomic_store_release(&segment->thread_id, 0);
|
||||
+ mi_atomic_store_release(&segment->thread_id, (uintptr_t)0);
|
||||
mi_assert_internal(segment->used == segment->abandoned);
|
||||
if (segment->memid.memkind != MI_MEM_ARENA) {
|
||||
// not in an arena; count it as abandoned and return
|
74
cmake/ports/mimalloc/portfile.cmake
Normal file
74
cmake/ports/mimalloc/portfile.cmake
Normal file
|
@ -0,0 +1,74 @@
|
|||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO microsoft/mimalloc
|
||||
REF "v${VERSION}"
|
||||
SHA512 4e30976758015c76a146acc1bfc8501e2e5c61b81db77d253de0d58a8edef987669243f232210667b32ef8da3a33286642acb56ba526fd24c4ba925b44403730
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix-cmake.patch
|
||||
add_ref_to_page_malloc_zero.patch
|
||||
fix-param.patch
|
||||
)
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
asm MI_SEE_ASM
|
||||
secure MI_SECURE
|
||||
override MI_OVERRIDE
|
||||
)
|
||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" MI_BUILD_STATIC)
|
||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" MI_BUILD_SHARED)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS_DEBUG
|
||||
-DMI_DEBUG_FULL=ON
|
||||
OPTIONS_RELEASE
|
||||
-DMI_DEBUG_FULL=OFF
|
||||
OPTIONS
|
||||
-DMI_USE_CXX=ON
|
||||
-DMI_BUILD_TESTS=OFF
|
||||
-DMI_BUILD_OBJECT=OFF
|
||||
${FEATURE_OPTIONS}
|
||||
-DMI_BUILD_STATIC=${MI_BUILD_STATIC}
|
||||
-DMI_BUILD_SHARED=${MI_BUILD_SHARED}
|
||||
-DMI_INSTALL_TOPLEVEL=ON
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(COPY
|
||||
"${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/usage"
|
||||
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}"
|
||||
)
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/mimalloc)
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
vcpkg_replace_string(
|
||||
"${CURRENT_PACKAGES_DIR}/include/mimalloc.h"
|
||||
"!defined(MI_SHARED_LIB)"
|
||||
"0 // !defined(MI_SHARED_LIB)"
|
||||
)
|
||||
endif()
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
set(mi_basename "mimalloc")
|
||||
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
string(APPEND mi_basename "-static")
|
||||
endif()
|
||||
if("secure" IN_LIST FEATURES)
|
||||
string(APPEND mi_basename "-secure")
|
||||
endif()
|
||||
if(NOT "mimalloc" STREQUAL "${mi_basename}")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/mimalloc.pc" " -lmimalloc" " -l${mi_basename}")
|
||||
endif()
|
||||
if(NOT VCPKG_BUILD_TYPE)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/mimalloc.pc" " -lmimalloc" " -l${mi_basename}-debug")
|
||||
endif()
|
||||
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
9
cmake/ports/mimalloc/usage
Normal file
9
cmake/ports/mimalloc/usage
Normal file
|
@ -0,0 +1,9 @@
|
|||
mimalloc provides CMake targets:
|
||||
|
||||
find_package(mimalloc CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:mimalloc-static>,mimalloc-static,mimalloc>)
|
||||
|
||||
To ensure the mimalloc-override.dll is loaded at runtime on Windows with
|
||||
dynamic linkage, it is suggested to insert some call to the mimalloc API
|
||||
in the main function, eg. `mi_version()`. Cf.
|
||||
https://github.com/microsoft/mimalloc/blob/dev/readme.md#dynamic-override-on-windows
|
21
cmake/ports/mimalloc/vcpkg-cmake-wrapper.cmake
Normal file
21
cmake/ports/mimalloc/vcpkg-cmake-wrapper.cmake
Normal file
|
@ -0,0 +1,21 @@
|
|||
_find_package(${ARGS})
|
||||
|
||||
if(CMAKE_CURRENT_LIST_DIR STREQUAL "${MIMALLOC_CMAKE_DIR}/${MIMALLOC_VERSION_DIR}")
|
||||
set(MIMALLOC_INCLUDE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
|
||||
# As in vcpkg.cmake
|
||||
if(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE MATCHES "^[Dd][Ee][Bb][Uu][Gg]$")
|
||||
set(MIMALLOC_LIBRARY_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib")
|
||||
else()
|
||||
set(MIMALLOC_LIBRARY_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib")
|
||||
endif()
|
||||
set(MIMALLOC_OBJECT_DIR "MIMALLOC_OBJECT_DIR-NOTFOUND") # not installed
|
||||
set(MIMALLOC_TARGET_DIR "${MIMALLOC_LIBRARY_DIR}")
|
||||
endif()
|
||||
|
||||
if(TARGET mimalloc AND NOT TARGET mimalloc-static)
|
||||
add_library(mimalloc-static INTERFACE IMPORTED)
|
||||
set_target_properties(mimalloc-static PROPERTIES INTERFACE_LINK_LIBRARIES mimalloc)
|
||||
elseif(TARGET mimalloc-static AND NOT TARGET mimalloc)
|
||||
add_library(mimalloc INTERFACE IMPORTED)
|
||||
set_target_properties(mimalloc PROPERTIES INTERFACE_LINK_LIBRARIES mimalloc-static)
|
||||
endif()
|
30
cmake/ports/mimalloc/vcpkg.json
Normal file
30
cmake/ports/mimalloc/vcpkg.json
Normal file
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"name": "mimalloc",
|
||||
"version": "2.1.7",
|
||||
"port-version": 1,
|
||||
"description": "Compact general purpose allocator with excellent performance",
|
||||
"homepage": "https://github.com/microsoft/mimalloc",
|
||||
"license": "MIT",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"features": {
|
||||
"asm": {
|
||||
"description": "Generate assembly files"
|
||||
},
|
||||
"override": {
|
||||
"description": "Override the standard malloc interface"
|
||||
},
|
||||
"secure": {
|
||||
"description": "Use security mitigations (like guard pages and randomization)"
|
||||
}
|
||||
}
|
||||
}
|
26
cmake/ports/robin-hood-hashing/portfile.cmake
Normal file
26
cmake/ports/robin-hood-hashing/portfile.cmake
Normal file
|
@ -0,0 +1,26 @@
|
|||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO martinus/robin-hood-hashing
|
||||
REF 3.11.5
|
||||
SHA512 5f73e089b1e8ec41a9bedded22bc64a789d3a3d04873a2ad9f8cc2970797a473b0f4d3436c2324b3ced85a0d983998a75b1dfaf2b7f3b77235b29806ff2fd489
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-DRH_STANDALONE_PROJECT=OFF
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_cmake_config_fixup(
|
||||
PACKAGE_NAME robin_hood
|
||||
CONFIG_PATH lib/cmake/robin_hood
|
||||
)
|
||||
|
||||
file(REMOVE_RECURSE
|
||||
"${CURRENT_PACKAGES_DIR}/debug"
|
||||
"${CURRENT_PACKAGES_DIR}/lib"
|
||||
)
|
||||
|
||||
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
16
cmake/ports/robin-hood-hashing/vcpkg.json
Normal file
16
cmake/ports/robin-hood-hashing/vcpkg.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"name": "robin-hood-hashing",
|
||||
"version": "3.11.5",
|
||||
"description": "Fast & memory efficient hashtable based on robin hood hashing for C++11/14/17/20",
|
||||
"homepage": "https://github.com/martinus/robin-hood-hashing",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
20
cmake/ports/spirv-headers/portfile.cmake
Normal file
20
cmake/ports/spirv-headers/portfile.cmake
Normal file
|
@ -0,0 +1,20 @@
|
|||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO KhronosGroup/SPIRV-Headers
|
||||
REF "vulkan-sdk-${VERSION}"
|
||||
SHA512 b4f975d3051eda41ef5c3a6efc832607a165adfd6f43d7af171d2c0446b227bdcb5de0017a081fa9e7a3d2710ba8583fadbc06c0a364043b2778b02818d01040
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
)
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
16
cmake/ports/spirv-headers/vcpkg.json
Normal file
16
cmake/ports/spirv-headers/vcpkg.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"name": "spirv-headers",
|
||||
"version": "1.3.296.0",
|
||||
"description": "Machine-readable files for the SPIR-V Registry",
|
||||
"homepage": "https://github.com/KhronosGroup/SPIRV-Headers",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
30
cmake/ports/spirv-reflect/export-targets.patch
Normal file
30
cmake/ports/spirv-reflect/export-targets.patch
Normal file
|
@ -0,0 +1,30 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 040c818..0e1476c 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -111,10 +111,20 @@ if(SPIRV_REFLECT_STATIC_LIB)
|
||||
add_library(spirv-reflect-static STATIC ${CMAKE_CURRENT_SOURCE_DIR}/spirv_reflect.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_reflect.c)
|
||||
|
||||
- target_include_directories(spirv-reflect-static
|
||||
- PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
- install(TARGETS spirv-reflect-static
|
||||
- LIBRARY DESTINATION lib
|
||||
- ARCHIVE DESTINATION lib)
|
||||
+ target_include_directories(spirv-reflect-static INTERFACE $<INSTALL_INTERFACE:include/spirv-reflect>)
|
||||
+
|
||||
+ set_target_properties(spirv-reflect-static PROPERTIES EXPORT_NAME spirv-reflect)
|
||||
+
|
||||
+ install(TARGETS spirv-reflect-static
|
||||
+ EXPORT unofficial-spirv-reflect-config
|
||||
+ LIBRARY DESTINATION lib)
|
||||
+
|
||||
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/spirv/unified1/spirv.h DESTINATION include/spirv-reflect)
|
||||
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/spirv_reflect.h DESTINATION include/spirv-reflect)
|
||||
+
|
||||
+ install(EXPORT unofficial-spirv-reflect-config
|
||||
+ FILE unofficial-spirv-reflect-config.cmake
|
||||
+ NAMESPACE unofficial::
|
||||
+ DESTINATION share/unofficial-spirv-reflect)
|
||||
endif()
|
||||
|
32
cmake/ports/spirv-reflect/portfile.cmake
Normal file
32
cmake/ports/spirv-reflect/portfile.cmake
Normal file
|
@ -0,0 +1,32 @@
|
|||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO KhronosGroup/SPIRV-Reflect
|
||||
REF "vulkan-sdk-${VERSION}"
|
||||
SHA512 770d46172fed140816dcecc3155bce62ce319f5cbe99bb58e81994e07aed14ebc8f65675c6e47dde2148e2706603ba470f364ab41bcbfbc05c69e25be7c5a898
|
||||
HEAD_REF main
|
||||
PATCHES
|
||||
export-targets.patch
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-DSPIRV_REFLECT_STATIC_LIB=ON
|
||||
-DSPIRV_REFLECT_EXAMPLES=OFF
|
||||
-DSPIRV_REFLECT_BUILD_TESTS=OFF
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-spirv-reflect)
|
||||
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/spirv-reflect/spirv_reflect.h" "./include/spirv/unified1/spirv.h" "spirv.h")
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
||||
|
||||
vcpkg_copy_tools(TOOL_NAMES spirv-reflect-pp spirv-reflect AUTO_CLEAN)
|
17
cmake/ports/spirv-reflect/vcpkg.json
Normal file
17
cmake/ports/spirv-reflect/vcpkg.json
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"name": "spirv-reflect",
|
||||
"version": "1.3.296.0",
|
||||
"description": "SPIRV-Reflect is a lightweight library that provides a C/C++ reflection API for SPIR-V shader bytecode in Vulkan applications.",
|
||||
"homepage": "https://github.com/KhronosGroup/SPIRV-Reflect",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
Source: spirv-tools
|
||||
Version: 2018.5-1
|
||||
Description: API and commands for processing SPIR-V modules
|
13
cmake/ports/spirv-tools/cmake-config-dir.diff
Normal file
13
cmake/ports/spirv-tools/cmake-config-dir.diff
Normal file
|
@ -0,0 +1,13 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 75830b44..367fe889 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -270,7 +270,7 @@ else()
|
||||
endif()
|
||||
|
||||
if(ENABLE_SPIRV_TOOLS_INSTALL)
|
||||
- if(WIN32 AND NOT MINGW)
|
||||
+ if(0)
|
||||
macro(spvtools_config_package_dir TARGET PATH)
|
||||
set(${PATH} ${TARGET}/cmake)
|
||||
endmacro()
|
18
cmake/ports/spirv-tools/fix-tool-deps.diff
Normal file
18
cmake/ports/spirv-tools/fix-tool-deps.diff
Normal file
|
@ -0,0 +1,18 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 75830b44..9c9e7ba8 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -281,8 +281,13 @@ if(ENABLE_SPIRV_TOOLS_INSTALL)
|
||||
endif()
|
||||
|
||||
macro(spvtools_generate_config_file TARGET)
|
||||
+ set(sgcf_find_extra "")
|
||||
+ if(NOT "${TARGET}" STREQUAL "SPIRV-Tools-opt")
|
||||
+ set(sgcf_find_extra "find_dependency(SPIRV-Tools-opt)\n")
|
||||
+ endif()
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/${TARGET}Config.cmake
|
||||
"include(CMakeFindDependencyMacro)\n"
|
||||
+ ${sgcf_find_extra}
|
||||
"find_dependency(${SPIRV_TOOLS})\n"
|
||||
"include(\${CMAKE_CURRENT_LIST_DIR}/${TARGET}Targets.cmake)\n"
|
||||
"set(${TARGET}_LIBRARIES ${TARGET})\n"
|
|
@ -1,41 +1,59 @@
|
|||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO KhronosGroup/SPIRV-Tools
|
||||
REF v2022.4
|
||||
SHA512 d93e97e168c50f545cc42418603ffc5fa6299bb3cc30d927444e4de0d955abc5dd481c9662a59cd49fc379da6bcc6df6fb747947e3dc144cee9b489aff7c4785
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SPIRV_HEADERS_PATH
|
||||
REPO KhronosGroup/SPIRV-Headers
|
||||
REF 85a1ed200d50660786c1a88d9166e871123cce39
|
||||
SHA512 1607cb8d3eaed838825f776b28219e6afe3524047f4d0670582fe757765369365a36dbf47abce71dde4cbd2448aeae4263fb29a4b6d034fbbf54bfab5e22b71c
|
||||
HEAD_REF master
|
||||
REF "vulkan-sdk-${VERSION}"
|
||||
SHA512 62f0a6034bd016aedfb8975bbd3bb134ef928bd6bafbb61d9f73c46760019597b9841b80243c86e5e5e0576824cd20255067e447590eb0d2d51593439152215e
|
||||
PATCHES
|
||||
cmake-config-dir.diff
|
||||
spirv-tools-shared.diff
|
||||
fix-tool-deps.diff
|
||||
)
|
||||
|
||||
vcpkg_find_acquire_program(PYTHON3)
|
||||
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
|
||||
vcpkg_add_to_path("${PYTHON3_DIR}")
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DSPIRV-Headers_SOURCE_DIR=${SPIRV_HEADERS_PATH}
|
||||
-DSPIRV_WERROR=OFF
|
||||
vcpkg_check_features(
|
||||
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
INVERTED_FEATURES
|
||||
tools SPIRV_SKIP_EXECUTABLES
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
${FEATURE_OPTIONS}
|
||||
"-DSPIRV-Headers_SOURCE_DIR=${CURRENT_INSTALLED_DIR}"
|
||||
-DSPIRV_SKIP_TESTS=ON
|
||||
-DSPIRV_TOOLS_BUILD_STATIC=ON
|
||||
-DSPIRV_WERROR=OFF
|
||||
OPTIONS_DEBUG
|
||||
-DSPIRV_SKIP_EXECUTABLES=ON
|
||||
)
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
||||
file(GLOB EXES "${CURRENT_PACKAGES_DIR}/bin/*")
|
||||
file(COPY ${EXES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools)
|
||||
file(REMOVE ${EXES})
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/SPIRV-Tools PACKAGE_NAME spirv-tools DO_NOT_DELETE_PARENT_CONFIG_PATH)
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/SPIRV-Tools-link PACKAGE_NAME spirv-tools-link DO_NOT_DELETE_PARENT_CONFIG_PATH)
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/SPIRV-Tools-lint PACKAGE_NAME spirv-tools-lint DO_NOT_DELETE_PARENT_CONFIG_PATH)
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/SPIRV-Tools-opt PACKAGE_NAME spirv-tools-opt DO_NOT_DELETE_PARENT_CONFIG_PATH)
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/SPIRV-Tools-reduce PACKAGE_NAME spirv-tools-reduce) # now delete
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
# Handle copyright
|
||||
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/spirv-tools)
|
||||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/spirv-tools/LICENSE ${CURRENT_PACKAGES_DIR}/share/spirv-tools/copyright)
|
||||
if("tools" IN_LIST FEATURES)
|
||||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
|
||||
file(RENAME "${CURRENT_PACKAGES_DIR}/bin/spirv-lesspipe.sh" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/spirv-lesspipe.sh")
|
||||
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/spirv-lesspipe.sh")
|
||||
set(tools spirv-as spirv-cfg spirv-dis spirv-link spirv-lint spirv-opt spirv-val)
|
||||
if(NOT VCPKG_TARGET_IS_IOS)
|
||||
list(APPEND tools spirv-reduce)
|
||||
endif()
|
||||
vcpkg_copy_tools(TOOL_NAMES ${tools} DESTINATION ${CURRENT_PACKAGES_DIR}/tools AUTO_CLEAN)
|
||||
endif()
|
||||
|
||||
file(REMOVE_RECURSE
|
||||
"${CURRENT_PACKAGES_DIR}/debug/include"
|
||||
"${CURRENT_PACKAGES_DIR}/debug/share"
|
||||
)
|
||||
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
||||
|
|
35
cmake/ports/spirv-tools/spirv-tools-shared.diff
Normal file
35
cmake/ports/spirv-tools/spirv-tools-shared.diff
Normal file
|
@ -0,0 +1,35 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 75830b44..39cc039e 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -390,10 +390,14 @@ add_custom_target(spirv-tools-shared-pkg-config ALL
|
||||
|
||||
# Install pkg-config file
|
||||
if (ENABLE_SPIRV_TOOLS_INSTALL)
|
||||
+ set(shared_pc "")
|
||||
+ if(BUILD_SHARED_LIBS)
|
||||
+ set(shared_pc "${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools-shared.pc")
|
||||
+ endif()
|
||||
install(
|
||||
FILES
|
||||
${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools.pc
|
||||
- ${CMAKE_CURRENT_BINARY_DIR}/SPIRV-Tools-shared.pc
|
||||
+ ${shared_pc}
|
||||
DESTINATION
|
||||
${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||
endif()
|
||||
diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
|
||||
index acfa0c12..b3286db3 100644
|
||||
--- a/source/CMakeLists.txt
|
||||
+++ b/source/CMakeLists.txt
|
||||
@@ -425,6 +425,10 @@ if (ANDROID)
|
||||
endif()
|
||||
|
||||
if(ENABLE_SPIRV_TOOLS_INSTALL)
|
||||
+ if(NOT BUILD_SHARED_LIBS)
|
||||
+ set_target_properties(${SPIRV_TOOLS}-shared PROPERTIES EXCLUDE_FROM_ALL 1)
|
||||
+ list(REMOVE_ITEM SPIRV_TOOLS_TARGETS ${SPIRV_TOOLS}-shared)
|
||||
+ endif()
|
||||
install(TARGETS ${SPIRV_TOOLS_TARGETS} EXPORT ${SPIRV_TOOLS}Targets)
|
||||
export(EXPORT ${SPIRV_TOOLS}Targets FILE ${SPIRV_TOOLS}Target.cmake)
|
||||
|
22
cmake/ports/spirv-tools/usage
Normal file
22
cmake/ports/spirv-tools/usage
Normal file
|
@ -0,0 +1,22 @@
|
|||
spirv-tools provides CMake targets:
|
||||
|
||||
find_package(SPIRV-Tools CONFIG REQUIRED)
|
||||
# The static libary is always available.
|
||||
# It offers full public symbol visibility.
|
||||
target_link_libraries(main PRIVATE SPIRV-Tools-static)
|
||||
# In triplets with dynamic library linkage, there is also a shared libary.
|
||||
target_link_libraries(main PRIVATE SPIRV-Tools-shared)
|
||||
|
||||
# The following libraries are static and depend on SPIRV-Tools-static.
|
||||
|
||||
find_package(SPIRV-Tools-link CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE SPIRV-Tools-link)
|
||||
|
||||
find_package(SPIRV-Tools-lint CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE SPIRV-Tools-lint)
|
||||
|
||||
find_package(SPIRV-Tools-opt CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE SPIRV-Tools-opt)
|
||||
|
||||
find_package(SPIRV-Tools-reduce CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE SPIRV-Tools-reduce)
|
26
cmake/ports/spirv-tools/vcpkg.json
Normal file
26
cmake/ports/spirv-tools/vcpkg.json
Normal file
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"name": "spirv-tools",
|
||||
"version": "1.3.296.0",
|
||||
"description": "API and commands for processing SPIR-V modules",
|
||||
"homepage": "https://github.com/KhronosGroup/SPIRV-Tools",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": [
|
||||
"spirv-headers",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"features": {
|
||||
"tools": {
|
||||
"description": "Build tools."
|
||||
}
|
||||
},
|
||||
"default-features": [
|
||||
"tools"
|
||||
]
|
||||
}
|
19
cmake/ports/vulkan-headers/portfile.cmake
Normal file
19
cmake/ports/vulkan-headers/portfile.cmake
Normal file
|
@ -0,0 +1,19 @@
|
|||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO KhronosGroup/Vulkan-Headers
|
||||
REF "vulkan-sdk-${VERSION}"
|
||||
SHA512 475cd0c3249c7998e5e85390651a6652e229d65e42adf3b4d18f9f7509037d217e87de01632c9b4142d26ab295cd2272c2e88f897a5420d693a82ff7e4003157
|
||||
HEAD_REF main
|
||||
)
|
||||
|
||||
set(VCPKG_BUILD_TYPE release) # header-only port
|
||||
|
||||
vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-DVULKAN_HEADERS_ENABLE_MODULE=OFF
|
||||
-DVULKAN_HEADERS_ENABLE_TESTS=OFF
|
||||
)
|
||||
vcpkg_cmake_install()
|
||||
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md")
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
4
cmake/ports/vulkan-headers/usage
Normal file
4
cmake/ports/vulkan-headers/usage
Normal file
|
@ -0,0 +1,4 @@
|
|||
Vulkan-Headers provides official find_package support:
|
||||
|
||||
find_package(VulkanHeaders CONFIG)
|
||||
target_link_libraries(main PRIVATE Vulkan::Headers)
|
18
cmake/ports/vulkan-headers/vcpkg.json
Normal file
18
cmake/ports/vulkan-headers/vcpkg.json
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "vulkan-headers",
|
||||
"version": "1.3.296.0",
|
||||
"description": "Vulkan header files and API registry",
|
||||
"homepage": "https://github.com/KhronosGroup/Vulkan-Headers",
|
||||
"license": "Apache-2.0 OR MIT",
|
||||
"supports": "!uwp & !xbox",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
24
cmake/ports/vulkan-utility-libraries/portfile.cmake
Normal file
24
cmake/ports/vulkan-utility-libraries/portfile.cmake
Normal file
|
@ -0,0 +1,24 @@
|
|||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO KhronosGroup/Vulkan-Utility-Libraries
|
||||
REF "vulkan-sdk-${VERSION}"
|
||||
SHA512 03466c78fbd43461990014a02deb06d2c4668c6230f336d3d9710e93aefa56d0ffadf959892c6d85c409088705e8ecf5fdd0a037b99af767b832f17fe4a44454
|
||||
HEAD_REF main
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-DBUILD_TESTS:BOOL=OFF
|
||||
)
|
||||
vcpkg_cmake_install()
|
||||
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/VulkanUtilityLibraries PACKAGE_NAME VulkanUtilityLibraries)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/VulkanUtilityLibraries/VulkanUtilityLibrariesConfig.cmake"
|
||||
[[${PACKAGE_PREFIX_DIR}/lib/cmake/VulkanUtilityLibraries/VulkanUtilityLibraries-targets.cmake]]
|
||||
[[${CMAKE_CURRENT_LIST_DIR}/VulkanUtilityLibraries-targets.cmake]]
|
||||
)
|
||||
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md")
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
18
cmake/ports/vulkan-utility-libraries/vcpkg.json
Normal file
18
cmake/ports/vulkan-utility-libraries/vcpkg.json
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"name": "vulkan-utility-libraries",
|
||||
"version": "1.3.296.0",
|
||||
"description": "Utility libraries for Vulkan developers",
|
||||
"homepage": "https://github.com/KhronosGroup/Vulkan-Utility-Libraries",
|
||||
"license": null,
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
},
|
||||
"vulkan-headers"
|
||||
]
|
||||
}
|
33
cmake/ports/vulkan-validationlayers/portfile.cmake
Normal file
33
cmake/ports/vulkan-validationlayers/portfile.cmake
Normal file
|
@ -0,0 +1,33 @@
|
|||
set(VCPKG_LIBRARY_LINKAGE dynamic)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO KhronosGroup/Vulkan-ValidationLayers
|
||||
REF "vulkan-sdk-${VERSION}"
|
||||
SHA512 457edee35a347456391c9b36bdf5d457f05210b6a8889d0623498582d3385bed474fbd7dae66406d20f70d96238ca752414eaa844b86b431ec7f8cf721d46d08
|
||||
HEAD_REF main
|
||||
)
|
||||
|
||||
vcpkg_find_acquire_program(PYTHON3)
|
||||
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
|
||||
vcpkg_add_to_path("${PYTHON3_DIR}")
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-DBUILD_TESTS:BOOL=OFF
|
||||
)
|
||||
vcpkg_cmake_install()
|
||||
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
|
||||
|
||||
set(VCPKG_POLICY_DLLS_WITHOUT_LIBS enabled)
|
||||
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
set(layer_path "<vcpkg_installed>/bin")
|
||||
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
set(layer_path "<vcpkg_installed>/share/vulkan/explicit_layer.d")
|
||||
endif()
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" @ONLY)
|
2
cmake/ports/vulkan-validationlayers/usage
Normal file
2
cmake/ports/vulkan-validationlayers/usage
Normal file
|
@ -0,0 +1,2 @@
|
|||
The package @PORT@ provides the vulkan validationlayers.
|
||||
To make vulkan use them you have to manually add the vcpkg path "@layer_path@" to the environment variable VK_ADD_LAYER_PATH.
|
25
cmake/ports/vulkan-validationlayers/vcpkg.json
Normal file
25
cmake/ports/vulkan-validationlayers/vcpkg.json
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"name": "vulkan-validationlayers",
|
||||
"version": "1.3.296.0",
|
||||
"description": "Vulkan Validation Layers (VVL)",
|
||||
"homepage": "https://github.com/KhronosGroup/Vulkan-ValidationLayers",
|
||||
"license": null,
|
||||
"dependencies": [
|
||||
"mimalloc",
|
||||
"robin-hood-hashing",
|
||||
"spirv-cross",
|
||||
"spirv-headers",
|
||||
"spirv-reflect",
|
||||
"spirv-tools",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
},
|
||||
"vulkan-headers",
|
||||
"vulkan-utility-libraries"
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue