aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/spirv-reflect
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/spirv-reflect')
-rw-r--r--vcpkg/ports/spirv-reflect/export-targets.patch30
-rw-r--r--vcpkg/ports/spirv-reflect/portfile.cmake32
-rw-r--r--vcpkg/ports/spirv-reflect/vcpkg.json17
3 files changed, 79 insertions, 0 deletions
diff --git a/vcpkg/ports/spirv-reflect/export-targets.patch b/vcpkg/ports/spirv-reflect/export-targets.patch
new file mode 100644
index 0000000..82a9fe7
--- /dev/null
+++ b/vcpkg/ports/spirv-reflect/export-targets.patch
@@ -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()
+
diff --git a/vcpkg/ports/spirv-reflect/portfile.cmake b/vcpkg/ports/spirv-reflect/portfile.cmake
new file mode 100644
index 0000000..6562216
--- /dev/null
+++ b/vcpkg/ports/spirv-reflect/portfile.cmake
@@ -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 d87ab91fd9b2ca6c86aaf72fd19332fb2d9eb7d5056480868ed79312fe111a3832099806d7a297fc82024683c8fe7ab96d7bec260f2828c111e535a85e288efb
+ 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)
diff --git a/vcpkg/ports/spirv-reflect/vcpkg.json b/vcpkg/ports/spirv-reflect/vcpkg.json
new file mode 100644
index 0000000..8022a11
--- /dev/null
+++ b/vcpkg/ports/spirv-reflect/vcpkg.json
@@ -0,0 +1,17 @@
+{
+ "name": "spirv-reflect",
+ "version": "1.4.309.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
+ }
+ ]
+}