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
|
2021-07-15 22:00:19 +08:00
|
|
|
REF adca18dcadd460eb517fe44f6cd2460fa0650ebe
|
|
|
|
SHA512 3a27d4c51be9e9396b9a854cb96d88e78ff2ca6dcb8400bd3288f6984d25876af0eae649aa1c72ad613edbbcfa4324a12809f13ceb7a0134eef41cb1a698dfdf
|
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
|
2021-07-24 00:04:43 +08:00
|
|
|
fix-install-shaderc_util.patch
|
2022-03-01 06:04:15 +08:00
|
|
|
fix-export-cmakefiles.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
|
|
|
|
2016-12-06 17:04:32 +08:00
|
|
|
set(OPTIONS)
|
|
|
|
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)
|
|
|
|
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}
|
|
|
|
-DSHADERC_SKIP_TESTS=true
|
2021-07-15 22:00:19 +08:00
|
|
|
-DSHADERC_GLSLANG_DIR=${CMAKE_CURRENT_LIST_DIR}/glslang
|
|
|
|
-DSHADERC_SPIRV_TOOLS_DIR=${CMAKE_CURRENT_LIST_DIR}/spirv-tools
|
|
|
|
-DSHADERC_ENABLE_EXAMPLES=OFF
|
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)
|
|
|
|
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-shaderc_util CONFIG_PATH share/unofficial-shaderc_util)
|
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
|
|
|
|
2021-02-11 16:24:45 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|