2021-02-11 16:24:45 +08:00
|
|
|
#Note: glslang and spir tools doesn't export symbol and need to be build as static lib for cmake to work
|
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
|
2017-09-06 03:58:53 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO google/shaderc
|
2023-12-09 09:10:03 +08:00
|
|
|
REF "v${VERSION}"
|
|
|
|
SHA512 f3c1db574312e7e5ee22fb64f47f6609369754dd1648eb4e51c30b3c40aafd9994e54560e8334d01ac7d00011285a94d0543fa9ecd6977ec34c39a965fd72269
|
2017-09-06 03:58:53 +08:00
|
|
|
HEAD_REF master
|
2019-06-28 06:38:53 +08:00
|
|
|
PATCHES
|
2021-02-11 16:24:45 +08:00
|
|
|
disable-update-version.patch
|
|
|
|
fix-build-type.patch
|
2023-06-14 11:48:27 +08:00
|
|
|
cmake-config-export.patch
|
2017-09-06 03:58:53 +08:00
|
|
|
)
|
2016-11-27 19:07:15 +08:00
|
|
|
|
2022-03-01 06:04:15 +08:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/build-version.inc" DESTINATION "${SOURCE_PATH}/glslc/src")
|
2016-11-27 19:07:15 +08:00
|
|
|
|
2023-06-14 11:48:27 +08:00
|
|
|
set(OPTIONS "")
|
2016-12-06 17:04:32 +08:00
|
|
|
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
|
|
|
|
list(APPEND OPTIONS -DSHADERC_ENABLE_SHARED_CRT=ON)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
# shaderc uses python to manipulate copyright information
|
|
|
|
vcpkg_find_acquire_program(PYTHON3)
|
2023-06-14 11:48:27 +08:00
|
|
|
get_filename_component(PYTHON3_EXE_PATH "${PYTHON3}" DIRECTORY)
|
2018-10-12 12:27:22 +08:00
|
|
|
vcpkg_add_to_path(PREPEND "${PYTHON3_EXE_PATH}")
|
2016-11-27 19:07:15 +08:00
|
|
|
|
2022-03-01 06:04:15 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2021-02-11 16:24:45 +08:00
|
|
|
OPTIONS
|
|
|
|
${OPTIONS}
|
2023-06-14 11:48:27 +08:00
|
|
|
"-DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_LIST_DIR}/cmake-project-include.cmake"
|
2021-07-15 22:00:19 +08:00
|
|
|
-DSHADERC_ENABLE_EXAMPLES=OFF
|
2023-06-14 11:48:27 +08:00
|
|
|
-DSHADERC_SKIP_TESTS=true
|
2016-11-27 19:07:15 +08:00
|
|
|
)
|
|
|
|
|
2022-03-01 06:04:15 +08:00
|
|
|
vcpkg_cmake_install()
|
2016-11-27 19:07:15 +08:00
|
|
|
|
2021-02-11 16:24:45 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2022-03-01 06:04:15 +08:00
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-shaderc CONFIG_PATH share/unofficial-shaderc)
|
2021-02-11 16:24:45 +08:00
|
|
|
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES glslc AUTO_CLEAN)
|
2016-11-27 19:07:15 +08:00
|
|
|
|
2022-03-01 06:04:15 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2016-11-27 19:07:15 +08:00
|
|
|
|
2023-06-14 11:48:27 +08:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2021-02-11 16:24:45 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|