diff --git a/ports/glslang/portfile.cmake b/ports/glslang/portfile.cmake new file mode 100644 index 00000000000..6c4a67042a3 --- /dev/null +++ b/ports/glslang/portfile.cmake @@ -0,0 +1,54 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KhronosGroup/glslang + REF "be564292f00c5bf0d7251c11f1c9618eb1117762" + SHA512 b581f404d7b5a6ee07650c45cc2493f1b200b50d4c504d397644a2dd7e88574f608532be21557eccc84fff727ad84b500476d565859e94ffbac11f647b156ad0 +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + tools ENABLE_GLSLANG_BINARIES + rtti ENABLE_RTTI +) + +if (ENABLE_GLSLANG_BINARIES) + vcpkg_find_acquire_program(PYTHON3) + get_filename_component(PYTHON_PATH ${PYTHON3} DIRECTORY) + vcpkg_add_to_path("${PYTHON_PATH}") +endif () + +if (WIN32) + set(PLATFORM_OPTIONS "-DOVERRIDE_MSVCCRT=OFF") +endif () + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DBUILD_EXTERNAL=OFF + -DENABLE_CTEST=OFF + -DSKIP_GLSLANG_INSTALL=OFF + -DENABLE_OPT=0 + ${FEATURE_OPTIONS} + ${PLATFORM_OPTIONS} +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/glslang DO_NOT_DELETE_PARENT_CONFIG_PATH) +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake) +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/glslang-config.cmake" + "${PACKAGE_PREFIX_DIR}/lib/cmake/glslang/glslang-targets.cmake" + "${PACKAGE_PREFIX_DIR}/share/${PORT}/glslang-targets.cmake" +) + +vcpkg_copy_pdbs() + +if (ENABLE_GLSLANG_BINARIES) + vcpkg_copy_tools(TOOL_NAMES glslangValidator spirv-remap AUTO_CLEAN) +endif () + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") diff --git a/ports/glslang/usage b/ports/glslang/usage new file mode 100644 index 00000000000..0ba43272275 --- /dev/null +++ b/ports/glslang/usage @@ -0,0 +1,4 @@ +glslang provides CMake targets: + + find_package(glslang CONFIG REQUIRED) + target_link_libraries(main PRIVATE glslang::OSDependent glslang::glslang glslang::MachineIndependent glslang::GenericCodeGen glslang::glslang-default-resource-limits glslang::OGLCompiler glslang::SPVRemapper glslang::SPIRV glslang::HLSL) diff --git a/ports/glslang/vcpkg.json b/ports/glslang/vcpkg.json new file mode 100644 index 00000000000..cb8ed91ee70 --- /dev/null +++ b/ports/glslang/vcpkg.json @@ -0,0 +1,26 @@ +{ + "name": "glslang", + "version-string": "main", + "description": "Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.", + "homepage": "https://github.com/KhronosGroup/glslang", + "license": "Apache-2.0 AND BSD-3-Clause AND MIT AND GPL-3.0-or-later", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "rtti": { + "description": "Build with dynamic typeinfo" + }, + "tools": { + "description": "Build the glslangValidator and spirv-remap binaries", + "supports": "!ios" + } + } +} diff --git a/ports/spirv-headers/portfile.cmake b/ports/spirv-headers/portfile.cmake new file mode 100644 index 00000000000..9f5137b0fb3 --- /dev/null +++ b/ports/spirv-headers/portfile.cmake @@ -0,0 +1,21 @@ + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KhronosGroup/SPIRV-Headers + REF e867c06631767a2d96424cbec530f9ee5e78180f + SHA512 b7cdedac508995defc1142947300bf699a511b2f3df80e63acc5783829df82ae2b40f9ccb32c1eb5d56b42728a34d0112bbe78ad1474d28efec707db8c4d94d6 + 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() + +# Handle copyright +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/spirv-headers/vcpkg.json b/ports/spirv-headers/vcpkg.json new file mode 100644 index 00000000000..e42ce93da35 --- /dev/null +++ b/ports/spirv-headers/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "spirv-headers", + "version": "1.3.231.1", + "port-version": 1, + "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 + } + ] +} diff --git a/ports/spirv-tools/portfile.cmake b/ports/spirv-tools/portfile.cmake new file mode 100644 index 00000000000..66c575efa15 --- /dev/null +++ b/ports/spirv-tools/portfile.cmake @@ -0,0 +1,55 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KhronosGroup/SPIRV-Tools + REF 360d469b9eac54d6c6e20f609f9ec35e3a5380ad + SHA512 026ee8477347a67443e3610e7988f9ec39f92ee2246d03e71915b582e079c467ebce0b8a99b66f881e7196150ba646a9062bfde1b3d30ef8e35c331a014ea1af +) + +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY) +vcpkg_add_to_path("${PYTHON3_DIR}") + +vcpkg_check_features( + OUT_FEATURE_OPTIONS FEATURE_OPTIONS + INVERTED_FEATURES + tools SPIRV_SKIP_EXECUTABLES +) + +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 +) + +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() + +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} 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}") +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/spirv-tools/usage b/ports/spirv-tools/usage new file mode 100644 index 00000000000..1890e6de9ab --- /dev/null +++ b/ports/spirv-tools/usage @@ -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) diff --git a/ports/spirv-tools/vcpkg.json b/ports/spirv-tools/vcpkg.json new file mode 100644 index 00000000000..605b708cf90 --- /dev/null +++ b/ports/spirv-tools/vcpkg.json @@ -0,0 +1,24 @@ +{ + "name": "spirv-tools", + "version": "2022.4", + "port-version": 1, + "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." + } + } +} diff --git a/ports/vulkan-headers/portfile.cmake b/ports/vulkan-headers/portfile.cmake new file mode 100644 index 00000000000..c78d6e7aca0 --- /dev/null +++ b/ports/vulkan-headers/portfile.cmake @@ -0,0 +1,14 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KhronosGroup/Vulkan-Headers + REF "v${VERSION}" + SHA512 74c99232bb5f23656621cf4c138fdb9e081d723b80d361674e00cd8e707d658daf24fec751d00927a1e1c4d3d5bd334a43da79cb038abb673af3ee76bb2750fb + HEAD_REF main +) + +set(VCPKG_BUILD_TYPE release) # header-only port + +vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}") +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}") diff --git a/ports/vulkan-headers/usage b/ports/vulkan-headers/usage new file mode 100644 index 00000000000..5b461a6d415 --- /dev/null +++ b/ports/vulkan-headers/usage @@ -0,0 +1,4 @@ +Vulkan-Headers provides official find_package support: + + find_package(VulkanHeaders CONFIG) + target_link_libraries(main PRIVATE Vulkan::Headers) diff --git a/ports/vulkan-headers/vcpkg.json b/ports/vulkan-headers/vcpkg.json new file mode 100644 index 00000000000..1e868e7763c --- /dev/null +++ b/ports/vulkan-headers/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "vulkan-headers", + "version": "1.3.269", + "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 + } + ] +} diff --git a/ports/vulkan-utility-libraries/portfile.cmake b/ports/vulkan-utility-libraries/portfile.cmake new file mode 100644 index 00000000000..01bb3a48256 --- /dev/null +++ b/ports/vulkan-utility-libraries/portfile.cmake @@ -0,0 +1,12 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KhronosGroup/Vulkan-Utility-Libraries + REF "v${VERSION}" + SHA512 b02a80b2f5ade91ede0364b2854d8f8d3dc6914e8ead3817014beee8e061a34b2ed7a897e536adfda3dee952526bb4925af175ab2c98f0c01145969440b1cf2f + HEAD_REF main +) + +vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}") +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}") diff --git a/ports/vulkan-utility-libraries/usage b/ports/vulkan-utility-libraries/usage new file mode 100644 index 00000000000..5b461a6d415 --- /dev/null +++ b/ports/vulkan-utility-libraries/usage @@ -0,0 +1,4 @@ +Vulkan-Headers provides official find_package support: + + find_package(VulkanHeaders CONFIG) + target_link_libraries(main PRIVATE Vulkan::Headers) diff --git a/ports/vulkan-utility-libraries/vcpkg.json b/ports/vulkan-utility-libraries/vcpkg.json new file mode 100644 index 00000000000..69e7b7af267 --- /dev/null +++ b/ports/vulkan-utility-libraries/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "vulkan-utility-libraries", + "version": "1.3.269", + "description": "VUL", + "homepage": "https://github.com/KhronosGroup/Vulkan-Utility-Libraries", + "license": "Apache-2.0 OR MIT", + "supports": "!uwp & !xbox", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 00000000000..a07ef16dd1f --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", + "name": "vulkan-validationlayers", + "version": "1.3.269", + "dependencies": [ + "vulkan-headers", + "vulkan-utility-libraries", + "spirv-headers", + "spirv-tools", + "glslang", + "robin-hood-hashing" + ], + "builtin-baseline": "3265c187c74914aa5569b75355badebfdbab7987", + "overrides": [ + { + "name": "robin-hood-hashing", + "version": "3.11.5" + } + ], + "vcpkg-configuration": { + "overlay-ports": [ + "./ports" + ] + } +} \ No newline at end of file