mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 22:49:06 +08:00
Merge pull request #1556 from atkawa7/glslang
[glslang] use vcpkg_from_github
This commit is contained in:
commit
2c8bbf0cae
@ -1,3 +1,3 @@
|
||||
Source: glslang
|
||||
Version: 1c573fbcfba6b3d631008b1babc838501ca925d3-1
|
||||
Version: 1c573fbcfba6b3d631008b1babc838501ca925d3-2
|
||||
Description: Khronos reference front-end for GLSL and ESSL, and sample SPIR-V generator
|
||||
|
@ -1,51 +1,30 @@
|
||||
# Common Ambient Variables:
|
||||
# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
|
||||
# TARGET_TRIPLET is the current triplet (x86-windows, etc)
|
||||
# PORT is the current port name (zlib, etc)
|
||||
# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
|
||||
# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
|
||||
#
|
||||
|
||||
include(vcpkg_common_functions)
|
||||
find_program(GIT git)
|
||||
|
||||
set(GIT_URL "https://github.com/KhronosGroup/glslang.git")
|
||||
set(GIT_REF "1c573fbcfba6b3d631008b1babc838501ca925d3")
|
||||
|
||||
if(NOT EXISTS "${DOWNLOADS}/glslang.git")
|
||||
message(STATUS "Cloning")
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${GIT} clone --bare ${GIT_URL} ${DOWNLOADS}/glslang.git
|
||||
WORKING_DIRECTORY ${DOWNLOADS}
|
||||
LOGNAME clone
|
||||
)
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
|
||||
message(WARNING "Dynamic not supported. Building static")
|
||||
set(VCPKG_LIBRARY_LINKAGE "static")
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git")
|
||||
message(STATUS "Adding worktree and patching")
|
||||
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR})
|
||||
vcpkg_execute_required_process(
|
||||
COMMAND ${GIT} worktree add -f --detach ${CURRENT_BUILDTREES_DIR}/src ${GIT_REF}
|
||||
WORKING_DIRECTORY ${DOWNLOADS}/glslang.git
|
||||
LOGNAME worktree
|
||||
)
|
||||
message(STATUS "Patching")
|
||||
endif()
|
||||
|
||||
set(VCPKG_LIBRARY_LINKAGE "static")
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO KhronosGroup/glslang
|
||||
REF 1c573fbcfba6b3d631008b1babc838501ca925d3
|
||||
SHA512 4f04dc39d9a70959ded1f4fe05ca5c7b0413c05bc3f049c11b5be7c8e1a70675f4221c9d8c712e7695f30eadb9bd7d0f1e71f431a6c9d4fea2cd2abbc73bd49a
|
||||
HEAD_REF master
|
||||
)
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/src"
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
file(COPY "${CURRENT_BUILDTREES_DIR}/src/glslang/Public" DESTINATION ${CURRENT_PACKAGES_DIR}/include/glslang)
|
||||
file(COPY "${CURRENT_BUILDTREES_DIR}/src/glslang/Include" DESTINATION ${CURRENT_PACKAGES_DIR}/include/glslang)
|
||||
file(COPY "${CURRENT_BUILDTREES_DIR}/src/glslang/MachineIndependent/Versions.h" DESTINATION ${CURRENT_PACKAGES_DIR}/include/glslang/MachineIndependent)
|
||||
file(COPY "${CURRENT_BUILDTREES_DIR}/src/SPIRV/Logger.h" DESTINATION ${CURRENT_PACKAGES_DIR}/include/SPIRV)
|
||||
file(COPY "${CURRENT_BUILDTREES_DIR}/src/SPIRV/spirv.hpp" DESTINATION ${CURRENT_PACKAGES_DIR}/include/SPIRV)
|
||||
file(COPY "${CURRENT_BUILDTREES_DIR}/src/SPIRV/GlslangToSpv.h" DESTINATION ${CURRENT_PACKAGES_DIR}/include/SPIRV)
|
||||
file(COPY "${SOURCE_PATH}/glslang/Public" DESTINATION ${CURRENT_PACKAGES_DIR}/include/glslang)
|
||||
file(COPY "${SOURCE_PATH}/glslang/Include" DESTINATION ${CURRENT_PACKAGES_DIR}/include/glslang)
|
||||
file(COPY "${SOURCE_PATH}/glslang/MachineIndependent/Versions.h" DESTINATION ${CURRENT_PACKAGES_DIR}/include/glslang/MachineIndependent)
|
||||
file(COPY "${SOURCE_PATH}/SPIRV/Logger.h" DESTINATION ${CURRENT_PACKAGES_DIR}/include/SPIRV)
|
||||
file(COPY "${SOURCE_PATH}/SPIRV/spirv.hpp" DESTINATION ${CURRENT_PACKAGES_DIR}/include/SPIRV)
|
||||
file(COPY "${SOURCE_PATH}/SPIRV/GlslangToSpv.h" DESTINATION ${CURRENT_PACKAGES_DIR}/include/SPIRV)
|
||||
file(COPY "${CURRENT_PACKAGES_DIR}/bin/glslangValidator.exe" DESTINATION ${CURRENT_PACKAGES_DIR}/tools)
|
||||
file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/glslangValidator.exe")
|
||||
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/glslangValidator.exe")
|
||||
@ -56,12 +35,12 @@ file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/spirv-remap.exe")
|
||||
file(GLOB BIN_DIR "${CURRENT_PACKAGES_DIR}/bin/*")
|
||||
list(LENGTH BIN_DIR BIN_DIR_SIZE)
|
||||
if(${BIN_DIR_SIZE} EQUAL 0)
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin")
|
||||
endif()
|
||||
file(GLOB DEBUG_BIN_DIR "${CURRENT_PACKAGES_DIR}/debug/bin/*")
|
||||
list(LENGTH DEBUG_BIN_DIR DEBUG_BIN_DIR_SIZE)
|
||||
if(${DEBUG_BIN_DIR_SIZE} EQUAL 0)
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin")
|
||||
endif()
|
||||
|
||||
# Handle copyright
|
||||
|
Loading…
Reference in New Issue
Block a user