mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-16 05:29:01 +08:00
bdea1d796b
- [X] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md). - [X] SHA512s are updated for each updated download. - [X] The "supports" clause reflects platforms that may be fixed by this new version. - [X] Any fixed [CI baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt) entries are removed from that file. - [X] Any patches that are no longer applied are deleted from the port's directory. - [X] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result. - [x] Only one version is added to each modified port's versions file. --------- Co-authored-by: Lily Wang <94091114+LilyWangLL@users.noreply.github.com>
56 lines
1.9 KiB
CMake
56 lines
1.9 KiB
CMake
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
vcpkg_from_github(
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
REPO KhronosGroup/glslang
|
|
REF "${VERSION}"
|
|
SHA512 570d2ff15116f48e195c73d9be1517b05e7c37541af10f6c05779a001e2d0295725349c1f4dd0bcca6f0c7e7e48c5162a60726c3e76cf04619c8e14bd0636ab6
|
|
HEAD_REF master
|
|
)
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
FEATURES
|
|
opt ENABLE_OPT
|
|
opt ALLOW_EXTERNAL_SPIRV_TOOLS
|
|
tools ENABLE_GLSLANG_BINARIES
|
|
rtti ENABLE_RTTI
|
|
)
|
|
|
|
if (ENABLE_GLSLANG_BINARIES)
|
|
vcpkg_find_acquire_program(PYTHON3)
|
|
get_filename_component(PYTHON_PATH ${PYTHON3} DIRECTORY)
|
|
vcpkg_add_to_path("${PYTHON_PATH}")
|
|
endif ()
|
|
|
|
vcpkg_cmake_configure(
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
OPTIONS
|
|
-DBUILD_EXTERNAL=OFF
|
|
-DGLSLANG_TESTS=OFF
|
|
${FEATURE_OPTIONS}
|
|
)
|
|
|
|
vcpkg_cmake_install()
|
|
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"
|
|
[[${PACKAGE_PREFIX_DIR}/lib/cmake/glslang/glslang-targets.cmake]]
|
|
[[${CMAKE_CURRENT_LIST_DIR}/glslang-targets.cmake]]
|
|
)
|
|
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()
|
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
if (ENABLE_GLSLANG_BINARIES)
|
|
vcpkg_copy_tools(TOOL_NAMES glslang glslangValidator spirv-remap AUTO_CLEAN)
|
|
endif ()
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
|
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
|