vcpkg/ports/spirv-tools/portfile.cmake

41 lines
1.4 KiB
CMake
Raw Normal View History

2016-12-13 03:07:43 +08:00
include(vcpkg_common_functions)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
2016-12-13 03:07:43 +08:00
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO KhronosGroup/SPIRV-Tools
REF d0a1f5a05a2b0f8315e5b3f17b8e34c730861b31
SHA512 7179751b0216368b4a4bf8c9b0c1c1e3b17d6aa4788b4aeaa7fbb2b6d9d50b34cf209082f3531a2e0994b5fc02416373666d4d12cee282cec2c3d02c13a640a8
PATCHES
comment-distutils.patch
CMake-targets.patch
)
2016-12-13 03:07:43 +08:00
vcpkg_find_acquire_program(PYTHON3)
get_filename_component(PYTHON3_DIR "${PYTHON3}" DIRECTORY)
vcpkg_add_to_path("${PYTHON3_DIR}")
2016-12-13 03:07:43 +08:00
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DSPIRV-Headers_SOURCE_DIR=${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}
-DSPIRV_WERROR=OFF
2016-12-13 03:07:43 +08:00
)
vcpkg_install_cmake()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(GLOB EXES "${CURRENT_PACKAGES_DIR}/bin/*${CMAKE_EXECUTABLE_SUFFIX}")
2016-12-13 03:07:43 +08:00
file(COPY ${EXES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools)
file(REMOVE ${EXES})
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
# 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)
2019-03-07 15:43:44 +08:00
vcpkg_test_cmake(PACKAGE_NAME spirv-tools)