2021-02-11 16:24:45 +08:00
|
|
|
#Note: glslang and spir tools doesn't export symbol and need to be build as static lib for cmake to work
|
|
|
|
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
|
|
|
|
2017-09-06 03:58:53 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO google/shaderc
|
2019-06-28 06:38:53 +08:00
|
|
|
REF 05c766a1f4615ee37d37d09271aaabca30ffd293
|
|
|
|
SHA512 329697e8e23d619313440d57ef740a94c49d13533e1b8734fc8ff72fd5092c2addabb306f64cb69160fa5fee373a05ba39a5ee6d92d95e5e2e9c7ec96a51aadc
|
2017-09-06 03:58:53 +08:00
|
|
|
HEAD_REF master
|
2019-06-28 06:38:53 +08:00
|
|
|
PATCHES
|
2021-02-11 16:24:45 +08:00
|
|
|
disable-update-version.patch
|
|
|
|
fix-install.patch
|
|
|
|
fix-build-type.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)
|
2019-06-28 06:38:53 +08:00
|
|
|
|
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)
|
2019-06-28 06:38:53 +08:00
|
|
|
|
2016-11-27 19:07:15 +08:00
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/build-version.inc DESTINATION ${SOURCE_PATH}/glslc/src)
|
|
|
|
|
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}
|
2019-08-01 04:01:02 +08:00
|
|
|
PREFER_NINJA
|
2021-02-11 16:24:45 +08:00
|
|
|
OPTIONS
|
|
|
|
${OPTIONS}
|
|
|
|
-DSHADERC_SKIP_TESTS=true
|
|
|
|
-Dglslang_SOURCE_DIR=${CURRENT_INSTALLED_DIR}/include
|
|
|
|
-Dspirv-tools_SOURCE_DIR=${CURRENT_INSTALLED_DIR}/include
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
-DSUFFIX_D=true
|
|
|
|
OPTIONS_RELEASE
|
|
|
|
-DSUFFIX_D=false
|
2016-11-27 19:07:15 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2021-02-11 16:24:45 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
|
|
|
|
vcpkg_copy_tools(TOOL_NAMES glslc AUTO_CLEAN)
|
2016-11-27 19:07:15 +08:00
|
|
|
|
2017-09-06 03:58:53 +08:00
|
|
|
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
|
2016-11-27 19:07:15 +08:00
|
|
|
|
2021-02-11 16:24:45 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|