2018-10-12 12:27:22 +08:00
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
2016-11-26 01:08:06 +08:00
|
|
|
|
2017-07-28 10:25:07 +08:00
|
|
|
vcpkg_from_github(
|
2023-03-25 13:58:22 +08:00
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO KhronosGroup/glslang
|
|
|
|
REF "${VERSION}"
|
2024-10-19 11:58:11 +08:00
|
|
|
SHA512 b246c6f280891b7c9b6cd0b5e85e03ccf1fe173cdfc40e566339a5698176cbcfe23eb7aeaba277f071222d76b9f2a00376d790d4d604aedad82e6196fab7fc70
|
2023-03-25 13:58:22 +08:00
|
|
|
HEAD_REF master
|
2017-07-28 10:25:07 +08:00
|
|
|
)
|
2016-11-26 01:08:06 +08:00
|
|
|
|
2023-03-25 13:58:22 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
2023-12-09 09:10:03 +08:00
|
|
|
opt ENABLE_OPT
|
|
|
|
opt ALLOW_EXTERNAL_SPIRV_TOOLS
|
2023-03-25 13:58:22 +08:00
|
|
|
tools ENABLE_GLSLANG_BINARIES
|
2023-08-08 00:59:24 +08:00
|
|
|
rtti ENABLE_RTTI
|
2023-03-25 13:58:22 +08:00
|
|
|
)
|
|
|
|
|
2024-07-06 01:45:48 +08:00
|
|
|
if(ENABLE_GLSLANG_BINARIES)
|
2023-03-25 13:58:22 +08:00
|
|
|
vcpkg_find_acquire_program(PYTHON3)
|
|
|
|
get_filename_component(PYTHON_PATH ${PYTHON3} DIRECTORY)
|
|
|
|
vcpkg_add_to_path("${PYTHON_PATH}")
|
2024-07-06 01:45:48 +08:00
|
|
|
endif()
|
2021-07-15 22:00:19 +08:00
|
|
|
|
2021-09-08 12:06:30 +08:00
|
|
|
vcpkg_cmake_configure(
|
2023-03-25 13:58:22 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
OPTIONS
|
|
|
|
-DBUILD_EXTERNAL=OFF
|
2024-03-12 07:38:39 +08:00
|
|
|
-DGLSLANG_TESTS=OFF
|
2023-03-25 13:58:22 +08:00
|
|
|
${FEATURE_OPTIONS}
|
2016-11-26 01:08:06 +08:00
|
|
|
)
|
|
|
|
|
2021-09-08 12:06:30 +08:00
|
|
|
vcpkg_cmake_install()
|
2023-03-25 13:58:22 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/glslang DO_NOT_DELETE_PARENT_CONFIG_PATH)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/glslang-config.cmake"
|
2023-12-23 16:52:06 +08:00
|
|
|
[[${PACKAGE_PREFIX_DIR}/lib/cmake/glslang/glslang-targets.cmake]]
|
|
|
|
[[${CMAKE_CURRENT_LIST_DIR}/glslang-targets.cmake]]
|
2023-03-25 13:58:22 +08:00
|
|
|
)
|
2023-12-23 16:52:06 +08:00
|
|
|
file(REMOVE_RECURSE CONFIG_PATH "${CURRENT_PACKAGES_DIR}/lib/cmake" "${CURRENT_PACKAGES_DIR}/debug/lib/cmake")
|
|
|
|
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/glslang/Public/ShaderLang.h" "ifdef GLSLANG_IS_SHARED_LIBRARY" "if 1")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/glslang/Include/glslang_c_interface.h" "ifdef GLSLANG_IS_SHARED_LIBRARY" "if 1")
|
|
|
|
endif()
|
2019-09-12 03:54:29 +08:00
|
|
|
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
2024-07-06 01:45:48 +08:00
|
|
|
if(ENABLE_GLSLANG_BINARIES)
|
2023-11-21 04:20:47 +08:00
|
|
|
vcpkg_copy_tools(TOOL_NAMES glslang glslangValidator spirv-remap AUTO_CLEAN)
|
2024-07-06 01:45:48 +08:00
|
|
|
endif()
|
2016-11-26 01:08:06 +08:00
|
|
|
|
2023-03-25 13:58:22 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2021-07-15 22:00:19 +08:00
|
|
|
|
2023-03-25 13:58:22 +08:00
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
|
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
|