2017-09-06 03:58:53 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO KhronosGroup/SPIRV-Tools
|
2022-11-15 06:30:12 +08:00
|
|
|
REF v2022.4
|
|
|
|
SHA512 d93e97e168c50f545cc42418603ffc5fa6299bb3cc30d927444e4de0d955abc5dd481c9662a59cd49fc379da6bcc6df6fb747947e3dc144cee9b489aff7c4785
|
2023-06-14 11:48:27 +08:00
|
|
|
PATCHES
|
|
|
|
cmake-config-dir.diff
|
|
|
|
spirv-tools-shared.diff
|
|
|
|
fix-tool-deps.diff
|
2017-09-06 03:58:53 +08:00
|
|
|
)
|
2016-12-13 03:07:43 +08:00
|
|
|
|
2017-09-06 03:58:53 +08:00
|
|
|
vcpkg_find_acquire_program(PYTHON3)
|
|
|
|
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
|
2018-10-12 12:27:22 +08:00
|
|
|
vcpkg_add_to_path("${PYTHON3_DIR}")
|
2016-12-13 03:07:43 +08:00
|
|
|
|
2023-06-14 11:48:27 +08:00
|
|
|
vcpkg_check_features(
|
|
|
|
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
INVERTED_FEATURES
|
|
|
|
tools SPIRV_SKIP_EXECUTABLES
|
|
|
|
)
|
2021-02-09 08:07:06 +08:00
|
|
|
|
2022-04-07 22:52:15 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2018-10-12 12:27:22 +08:00
|
|
|
OPTIONS
|
2023-06-14 11:48:27 +08:00
|
|
|
${FEATURE_OPTIONS}
|
|
|
|
"-DSPIRV-Headers_SOURCE_DIR=${CURRENT_INSTALLED_DIR}"
|
2022-04-07 22:52:15 +08:00
|
|
|
-DSPIRV_SKIP_TESTS=ON
|
2021-04-20 08:09:40 +08:00
|
|
|
-DSPIRV_TOOLS_BUILD_STATIC=ON
|
2023-06-14 11:48:27 +08:00
|
|
|
-DSPIRV_WERROR=OFF
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DSPIRV_SKIP_EXECUTABLES=ON
|
2016-12-13 03:07:43 +08:00
|
|
|
)
|
|
|
|
|
2022-04-07 22:52:15 +08:00
|
|
|
vcpkg_cmake_install()
|
2023-06-14 11:48:27 +08:00
|
|
|
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
|
2021-04-20 08:09:40 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2020-03-20 15:32:07 +08:00
|
|
|
|
2023-06-14 11:48:27 +08:00
|
|
|
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)
|
2022-04-07 22:52:15 +08:00
|
|
|
endif()
|
|
|
|
|
|
|
|
file(REMOVE_RECURSE
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/include"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/share"
|
|
|
|
)
|
2020-03-20 15:32:07 +08:00
|
|
|
|
2023-06-14 11:48:27 +08:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2020-03-20 15:32:07 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|