2016-11-27 19:07:15 +08:00
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
2017-09-06 03:58:53 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO google/shaderc
|
|
|
|
REF 12fb656ab20ea9aa06e7084a74e5ff832b7ce2da
|
|
|
|
SHA512 6fb45a0b01e6709c44a11658648b9271fe06bd94023dcc5042c47b5f2a04889c2efb0ab4c166f18728594ac9b9aa9f8b354af46d88eb7f7c39c7246f52f5a933
|
|
|
|
HEAD_REF master
|
2018-10-12 12:27:22 +08:00
|
|
|
PATCHES
|
|
|
|
0001-Do-not-generate-build-version.inc.patch
|
2017-09-06 03:58:53 +08:00
|
|
|
)
|
2016-11-27 19:07:15 +08:00
|
|
|
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}/third_party/glslang)
|
2016-12-17 18:42:30 +08:00
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists_spirv.txt DESTINATION ${SOURCE_PATH}/third_party/spirv-tools)
|
|
|
|
file(RENAME ${SOURCE_PATH}/third_party/spirv-tools/CMakeLists_spirv.txt ${SOURCE_PATH}/third_party/spirv-tools/CMakeLists.txt)
|
2016-11-27 19:07:15 +08:00
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/build-version.inc DESTINATION ${SOURCE_PATH}/glslc/src)
|
|
|
|
|
|
|
|
#Note: glslang and spir tools doesn't export symbol and need to be build as static lib for cmake to work
|
|
|
|
set(VCPKG_LIBRARY_LINKAGE "static")
|
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
|
|
|
|
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2018-10-12 12:27:22 +08:00
|
|
|
OPTIONS -DSHADERC_SKIP_TESTS=true ${OPTIONS} -Dglslang_SOURCE_DIR=${CURRENT_INSTALLED_DIR}/include
|
2016-11-27 19:07:15 +08:00
|
|
|
OPTIONS_DEBUG -DSUFFIX_D=true
|
|
|
|
OPTIONS_RELEASE -DSUFFIX_D=false
|
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2019-02-16 03:09:02 +08:00
|
|
|
file(GLOB EXES "${CURRENT_PACKAGES_DIR}/bin/*${CMAKE_EXECUTABLE_SUFFIX}")
|
2016-11-27 19:07:15 +08:00
|
|
|
file(COPY ${EXES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools)
|
|
|
|
|
|
|
|
#Safe to remove as libs are static
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
|
2017-09-06 03:58:53 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
2016-11-27 19:07:15 +08:00
|
|
|
|
|
|
|
# Handle copyright
|
|
|
|
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/shaderc)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/shaderc/LICENSE ${CURRENT_PACKAGES_DIR}/share/shaderc/copyright)
|