aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/glslang
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/glslang
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/glslang')
-rw-r--r--vcpkg/ports/glslang/portfile.cmake55
-rw-r--r--vcpkg/ports/glslang/usage4
-rw-r--r--vcpkg/ports/glslang/vcpkg.json32
3 files changed, 91 insertions, 0 deletions
diff --git a/vcpkg/ports/glslang/portfile.cmake b/vcpkg/ports/glslang/portfile.cmake
new file mode 100644
index 0000000..9f1727b
--- /dev/null
+++ b/vcpkg/ports/glslang/portfile.cmake
@@ -0,0 +1,55 @@
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO KhronosGroup/glslang
+ REF "${VERSION}"
+ SHA512 8ba7e5f73746b221ff39387282e2d929d1142c60d1c79019f4c21c84b105fb59253e88f2f649a25e9bb7ab01094e455f002c7412aeea882548fac4a426eee809
+ 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")
diff --git a/vcpkg/ports/glslang/usage b/vcpkg/ports/glslang/usage
new file mode 100644
index 0000000..6512fec
--- /dev/null
+++ b/vcpkg/ports/glslang/usage
@@ -0,0 +1,4 @@
+glslang provides CMake targets:
+
+ find_package(glslang CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE glslang::glslang glslang::glslang-default-resource-limits glslang::SPIRV glslang::SPVRemapper)
diff --git a/vcpkg/ports/glslang/vcpkg.json b/vcpkg/ports/glslang/vcpkg.json
new file mode 100644
index 0000000..25e3580
--- /dev/null
+++ b/vcpkg/ports/glslang/vcpkg.json
@@ -0,0 +1,32 @@
+{
+ "name": "glslang",
+ "version": "15.1.0",
+ "description": "Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.",
+ "homepage": "https://github.com/KhronosGroup/glslang",
+ "license": "Apache-2.0 AND BSD-3-Clause AND MIT AND GPL-3.0-or-later",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "opt": {
+ "description": "Build with spirv-opt capability",
+ "dependencies": [
+ "spirv-tools"
+ ]
+ },
+ "rtti": {
+ "description": "Build with dynamic typeinfo"
+ },
+ "tools": {
+ "description": "Build the glslangValidator and spirv-remap binaries",
+ "supports": "!ios"
+ }
+ }
+}