From 071f53715b988b93a20da59c55fd85ee2aa6d65d Mon Sep 17 00:00:00 2001 From: Luke Date: Thu, 15 Jul 2021 16:00:19 +0200 Subject: [PATCH] [glslang] Update to 11.1.0 (#15719) * [shaderc] remove port since it does not build * [glslang] updated to version 11.1.0 * [glslang] Add python path * [glslang] baseline.json and glslang.json updated * Update portfile.cmake * Update CONTROL * Update port_versions * Update port_versions * Update port_versions * Update port_versions * Update port_versions * [glslang] port update to version 11.4.0 * [glslang] port version removed from json * [glslang] remove shaderc * [glslang] baseline update * [glslang] versions hash update * [glslang] portfile format fix + use of ${PORT} * [glslang] new hash * [glslang] revert portfile back * [glslang] portfile apply changes * [glslang] update hash for x86 windows * [glslang] update to 1.5.0 * [glslang] git-tree hash update * [glslang] remove old version 1.4.0 * [glslang] git-tree hash update * [glslang][shaderc] Update and fix targets to match upstream * Update versions Co-authored-by: Lukas Lipp Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> Co-authored-by: JonLiu1993 <13720414433@163.com> Co-authored-by: Robert Schumacher --- ports/glslang/CMakeLists-targets.patch | 121 ------------------ ports/glslang/CMakeLists-windows.patch | 12 -- .../always-install-resource-limits.patch | 13 ++ ports/glslang/glslang-config.cmake | 7 + ports/glslang/ignore-crt.patch | 9 ++ ports/glslang/portfile.cmake | 32 +++-- ports/glslang/vcpkg.json | 3 +- ports/shaderc/CMakeLists.txt | 31 ----- ports/shaderc/CONTROL | 6 - ports/shaderc/build-version.inc | 6 +- ports/shaderc/disable-update-version.patch | 23 +--- ports/shaderc/fix-build-type.patch | 70 ++++------ ports/shaderc/fix-install.patch | 26 ---- ports/shaderc/glslang/CMakeLists.txt | 13 ++ ports/shaderc/portfile.cmake | 19 +-- .../CMakeLists.txt} | 0 ports/shaderc/vcpkg.json | 10 ++ versions/baseline.json | 8 +- versions/g-/glslang.json | 6 +- versions/s-/shaderc.json | 5 + 20 files changed, 124 insertions(+), 296 deletions(-) delete mode 100644 ports/glslang/CMakeLists-targets.patch delete mode 100644 ports/glslang/CMakeLists-windows.patch create mode 100644 ports/glslang/always-install-resource-limits.patch create mode 100644 ports/glslang/glslang-config.cmake create mode 100644 ports/glslang/ignore-crt.patch delete mode 100644 ports/shaderc/CMakeLists.txt delete mode 100644 ports/shaderc/CONTROL delete mode 100644 ports/shaderc/fix-install.patch create mode 100644 ports/shaderc/glslang/CMakeLists.txt rename ports/shaderc/{CMakeLists_spirv.txt => spirv-tools/CMakeLists.txt} (100%) create mode 100644 ports/shaderc/vcpkg.json diff --git a/ports/glslang/CMakeLists-targets.patch b/ports/glslang/CMakeLists-targets.patch deleted file mode 100644 index 53cf5bf8f0..0000000000 --- a/ports/glslang/CMakeLists-targets.patch +++ /dev/null @@ -1,121 +0,0 @@ -diff --git a/ChooseMSVCCRT.cmake b/ChooseMSVCCRT.cmake -index 2097881..f6320a9 100644 ---- a/ChooseMSVCCRT.cmake -+++ b/ChooseMSVCCRT.cmake -@@ -102,4 +102,3 @@ set(MSVC_CRT - MT - MTd) - --choose_msvc_crt(MSVC_CRT) -diff --git a/OGLCompilersDLL/CMakeLists.txt b/OGLCompilersDLL/CMakeLists.txt -index 5bb3f0e..90ba3be 100644 ---- a/OGLCompilersDLL/CMakeLists.txt -+++ b/OGLCompilersDLL/CMakeLists.txt -@@ -9,6 +9,7 @@ if(WIN32) - endif(WIN32) - - if(ENABLE_GLSLANG_INSTALL) -- install(TARGETS OGLCompiler -- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ install(TARGETS OGLCompiler EXPORT glslangConfig -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(ENABLE_GLSLANG_INSTALL) -diff --git a/SPIRV/CMakeLists.txt b/SPIRV/CMakeLists.txt -index 1997e74..e2a0229 100644 ---- a/SPIRV/CMakeLists.txt -+++ b/SPIRV/CMakeLists.txt -@@ -46,7 +46,6 @@ endif(ENABLE_NV_EXTENSIONS) - add_library(SPIRV ${LIB_TYPE} ${SOURCES} ${HEADERS}) - set_property(TARGET SPIRV PROPERTY FOLDER glslang) - set_property(TARGET SPIRV PROPERTY POSITION_INDEPENDENT_CODE ON) --target_include_directories(SPIRV PUBLIC ..) - - if (ENABLE_SPVREMAPPER) - add_library(SPVRemapper ${LIB_TYPE} ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS}) -@@ -78,13 +77,13 @@ if(WIN32) - endif(WIN32) - - if(ENABLE_GLSLANG_INSTALL) -- if(BUILD_SHARED_LIBS) -+ if(BUILD_SHARED_LIBS OR TRUE) - if (ENABLE_SPVREMAPPER) - install(TARGETS SPVRemapper - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif() -- install(TARGETS SPIRV -+ install(TARGETS SPIRV EXPORT glslangConfig - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) - else() -diff --git a/glslang/CMakeLists.txt b/glslang/CMakeLists.txt -index 5f51476..7f11498 100644 ---- a/glslang/CMakeLists.txt -+++ b/glslang/CMakeLists.txt -@@ -86,7 +86,6 @@ add_library(glslang ${LIB_TYPE} ${BISON_GLSLParser_OUTPUT_SOURCE} ${SOURCES} ${H - set_property(TARGET glslang PROPERTY FOLDER glslang) - set_property(TARGET glslang PROPERTY POSITION_INDEPENDENT_CODE ON) - target_link_libraries(glslang OGLCompiler OSDependent) --target_include_directories(glslang PUBLIC ..) - - if(WIN32 AND BUILD_SHARED_LIBS) - set_target_properties(glslang PROPERTIES PREFIX "") -@@ -105,10 +104,15 @@ if(WIN32) - endif(WIN32) - - if(ENABLE_GLSLANG_INSTALL) -- if(BUILD_SHARED_LIBS) -- install(TARGETS glslang -+ if(BUILD_SHARED_LIBS OR TRUE) -+ install(TARGETS glslang EXPORT glslangConfig - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ install( -+ EXPORT glslangConfig -+ DESTINATION "${CMAKE_INSTALL_PREFIX}/share/glslang" -+ NAMESPACE glslang:: -+ ) - else() - install(TARGETS glslang - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -diff --git a/glslang/OSDependent/Unix/CMakeLists.txt b/glslang/OSDependent/Unix/CMakeLists.txt -index e652f45..a9673fe 100644 ---- a/glslang/OSDependent/Unix/CMakeLists.txt -+++ b/glslang/OSDependent/Unix/CMakeLists.txt -@@ -20,6 +20,6 @@ else() - endif() - - if(ENABLE_GLSLANG_INSTALL) -- install(TARGETS OSDependent -+ install(TARGETS OSDependent EXPORT glslangConfig - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(ENABLE_GLSLANG_INSTALL) -diff --git a/hlsl/CMakeLists.txt b/hlsl/CMakeLists.txt -index f918d7a..329800f 100644 ---- a/hlsl/CMakeLists.txt -+++ b/hlsl/CMakeLists.txt -@@ -32,8 +32,8 @@ if(WIN32) - endif(WIN32) - - if(ENABLE_GLSLANG_INSTALL) -- if(BUILD_SHARED_LIBS) -- install(TARGETS HLSL -+ if(BUILD_SHARED_LIBS OR TRUE) -+ install(TARGETS HLSL EXPORT glslangConfig - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) - else() -diff --git a/StandAlone/CMakeLists.txt b/StandAlone/CMakeLists.txt -index 5cea53d9..43e45534 100644 ---- a/StandAlone/CMakeLists.txt -+++ b/StandAlone/CMakeLists.txt -@@ -46,7 +46,7 @@ if(ENABLE_GLSLANG_INSTALL) - install(TARGETS spirv-remap - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - -- if(BUILD_SHARED_LIBS) -+ if(BUILD_SHARED_LIBS OR TRUE) - install(TARGETS glslang-default-resource-limits - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif() diff --git a/ports/glslang/CMakeLists-windows.patch b/ports/glslang/CMakeLists-windows.patch deleted file mode 100644 index 76ccf6077c..0000000000 --- a/ports/glslang/CMakeLists-windows.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/glslang/OSDependent/Windows/CMakeLists.txt b/glslang/OSDependent/Windows/CMakeLists.txt -index f257418..82a3f3c 100644 ---- a/glslang/OSDependent/Windows/CMakeLists.txt -+++ b/glslang/OSDependent/Windows/CMakeLists.txt -@@ -15,6 +15,6 @@ if(WIN32) - endif(WIN32) - - if(ENABLE_GLSLANG_INSTALL) -- install(TARGETS OSDependent -+ install(TARGETS OSDependent EXPORT glslangConfig - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif(ENABLE_GLSLANG_INSTALL) diff --git a/ports/glslang/always-install-resource-limits.patch b/ports/glslang/always-install-resource-limits.patch new file mode 100644 index 0000000000..56c34dfc44 --- /dev/null +++ b/ports/glslang/always-install-resource-limits.patch @@ -0,0 +1,13 @@ +diff --git a/StandAlone/CMakeLists.txt b/StandAlone/CMakeLists.txt +index 751d1cd71..0f5cf0dc0 100644 +--- a/StandAlone/CMakeLists.txt ++++ b/StandAlone/CMakeLists.txt +@@ -98,7 +98,7 @@ if(ENABLE_GLSLANG_INSTALL) + install(EXPORT spirv-remapTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) + endif() + +- if(BUILD_SHARED_LIBS) ++ if(BUILD_SHARED_LIBS OR TRUE) + install(TARGETS glslang-default-resource-limits EXPORT glslang-default-resource-limitsTargets + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} diff --git a/ports/glslang/glslang-config.cmake b/ports/glslang/glslang-config.cmake new file mode 100644 index 0000000000..5eb356151f --- /dev/null +++ b/ports/glslang/glslang-config.cmake @@ -0,0 +1,7 @@ +include(CMakeFindDependencyMacro) + +find_dependency(Threads) + +foreach(targets OGLCompiler OSDependent glslang glslang-default-resource-limits glslangValidator HLSL SPIRV spirv-remap SPVRemapper) + include("${CMAKE_CURRENT_LIST_DIR}/${targets}Targets.cmake" OPTIONAL) +endforeach() diff --git a/ports/glslang/ignore-crt.patch b/ports/glslang/ignore-crt.patch new file mode 100644 index 0000000000..0835b49a9f --- /dev/null +++ b/ports/glslang/ignore-crt.patch @@ -0,0 +1,9 @@ +diff --git a/ChooseMSVCCRT.cmake b/ChooseMSVCCRT.cmake +index b1561263..b6c8c3a6 100644 +--- a/ChooseMSVCCRT.cmake ++++ b/ChooseMSVCCRT.cmake +@@ -135,4 +135,3 @@ set(MSVC_CRT + MT + MTd) + +-choose_msvc_crt(MSVC_CRT) diff --git a/ports/glslang/portfile.cmake b/ports/glslang/portfile.cmake index da955a8885..2ee7c9b3af 100644 --- a/ports/glslang/portfile.cmake +++ b/ports/glslang/portfile.cmake @@ -3,14 +3,18 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO KhronosGroup/glslang - REF f88e5824d2cfca5edc58c7c2101ec9a4ec36afac - SHA512 92dc287e8930db6e00bde23b770f763dc3cf8a405a37b682bbd65e1dbde1f1f5161543fcc70b09eef07a5ce8bbe8f368ef84ac75003c122f42d1f6b9eaa8bd50 + REF ae2a562936cc8504c9ef2757cceaff163147834f + SHA512 1c5a91e60c1809c6c26f11649659090a75501b0570f3147e5b27ac65c539b591967f258d14c399d33019317864ede823353ea44e0015bc3f7afc5a787f046cc7 HEAD_REF master PATCHES - CMakeLists-targets.patch - CMakeLists-windows.patch + ignore-crt.patch + always-install-resource-limits.patch ) +vcpkg_find_acquire_program(PYTHON3) +get_filename_component(PYTHON_PATH ${PYTHON3} DIRECTORY) +vcpkg_add_to_path("${PYTHON_PATH}") + if(VCPKG_TARGET_IS_IOS) # this case will report error since all executable will require BUNDLE DESTINATION set(BUILD_BINARIES OFF) @@ -22,24 +26,32 @@ vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS - -DCMAKE_DEBUG_POSTFIX=d -DSKIP_GLSLANG_INSTALL=OFF + -DBUILD_EXTERNAL=OFF -DENABLE_GLSLANG_BINARIES=${BUILD_BINARIES} ) vcpkg_install_cmake() - -vcpkg_fixup_cmake_targets(CONFIG_PATH share/glslang) +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake TARGET_PATH share/glslang) vcpkg_copy_pdbs() if(NOT BUILD_BINARIES) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) else() - file(RENAME ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/tools) + file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) + file(RENAME ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/tools/glslang) endif() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/bin) -# Handle copyright -file(COPY ${CMAKE_CURRENT_LIST_DIR}/copyright DESTINATION ${CURRENT_PACKAGES_DIR}/share/glslang) +if(EXISTS ${CURRENT_PACKAGES_DIR}/share/glslang/glslang-config.cmake OR EXISTS ${CURRENT_PACKAGES_DIR}/share/glslang/glslangConfig.cmake) + message(FATAL_ERROR "glslang has been updated to provide a -config file -- please remove the vcpkg provided version from the portfile") +endif() + +file(COPY + ${CMAKE_CURRENT_LIST_DIR}/copyright + ${CMAKE_CURRENT_LIST_DIR}/glslang-config.cmake + DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} +) + diff --git a/ports/glslang/vcpkg.json b/ports/glslang/vcpkg.json index 24579e6890..addd408f36 100644 --- a/ports/glslang/vcpkg.json +++ b/ports/glslang/vcpkg.json @@ -1,7 +1,6 @@ { "name": "glslang", - "version-string": "2019-03-05", - "port-version": 3, + "version": "11.5.0", "description": "Khronos reference front-end for GLSL and ESSL, and sample SPIR-V generator", "homepage": "https://github.com/KhronosGroup/glslang" } diff --git a/ports/shaderc/CMakeLists.txt b/ports/shaderc/CMakeLists.txt deleted file mode 100644 index 7ecdd03f91..0000000000 --- a/ports/shaderc/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -option(SUFFIX_D "Add d Suffix to lib" ${SUFFIX_D}) -if(NOT SUFFIX_D) - find_library(GLSLANG glslang) - find_library(OSDEPENDENT OSDependent) - find_library(OGLCOMPILER OGLCompiler) - find_library(HLSLLIB HLSL) - find_library(SPIRVLIB SPIRV) -ELSE() - find_library(GLSLANG glslangd) - find_library(OSDEPENDENT OSDependentd) - find_library(OGLCOMPILER OGLCompilerd) - find_library(HLSLLIB HLSLd) - find_library(SPIRVLIB SPIRVd) -ENDIF() - -add_library(glslang STATIC IMPORTED GLOBAL) -set_property(TARGET glslang PROPERTY IMPORTED_LOCATION "${GLSLANG}") -find_path(glslang_SOURCE_DIR glslang/Include/Common) -set_property(TARGET glslang APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${glslang_SOURCE_DIR}") - -add_library(OSDependent STATIC IMPORTED GLOBAL) -set_property(TARGET OSDependent PROPERTY IMPORTED_LOCATION "${OSDEPENDENT}") - -add_library(OGLCompiler STATIC IMPORTED GLOBAL) -set_property(TARGET OGLCompiler PROPERTY IMPORTED_LOCATION "${OGLCOMPILER}") - -add_library(HLSL STATIC IMPORTED GLOBAL) -set_property(TARGET HLSL PROPERTY IMPORTED_LOCATION "${HLSLLIB}") - -add_library(SPIRV STATIC IMPORTED GLOBAL) -set_property(TARGET SPIRV PROPERTY IMPORTED_LOCATION "${SPIRVLIB}") diff --git a/ports/shaderc/CONTROL b/ports/shaderc/CONTROL deleted file mode 100644 index e700a40103..0000000000 --- a/ports/shaderc/CONTROL +++ /dev/null @@ -1,6 +0,0 @@ -Source: shaderc -Version: 2019-06-26 -Port-Version: 2 -Homepage: https://github.com/google/shaderc -Description: A collection of tools, libraries and tests for shader compilation. -Build-Depends: glslang, spirv-tools \ No newline at end of file diff --git a/ports/shaderc/build-version.inc b/ports/shaderc/build-version.inc index 00c140577a..d5b1449e2b 100644 --- a/ports/shaderc/build-version.inc +++ b/ports/shaderc/build-version.inc @@ -1,5 +1 @@ -"shaderc v2019.0-dev unknown hash, 2019-05-08\n" -"spirv-tools v2019.3-dev unknown hash, 2019-04-03\n" -"glslang unknown hash, 2019-03-05\n" - - +"shaderc v2021.1-dev unknown hash, 2021-06-21\n" diff --git a/ports/shaderc/disable-update-version.patch b/ports/shaderc/disable-update-version.patch index 5ee016bcb1..7bf47bd508 100644 --- a/ports/shaderc/disable-update-version.patch +++ b/ports/shaderc/disable-update-version.patch @@ -2,19 +2,18 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index a4e779b..dc5f1a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -81,12 +81,6 @@ add_subdirectory(libshaderc) - add_subdirectory(glslc) - add_subdirectory(examples) +@@ -121,11 +121,6 @@ if(${SHADERC_ENABLE_EXAMPLES}) + add_subdirectory(examples) + endif() -add_custom_target(build-version - ${PYTHON_EXECUTABLE} - ${CMAKE_CURRENT_SOURCE_DIR}/utils/update_build_version.py -- ${shaderc_SOURCE_DIR} ${spirv-tools_SOURCE_DIR} ${glslang_SOURCE_DIR} +- ${shaderc_SOURCE_DIR} ${spirv-tools_SOURCE_DIR} ${glslang_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/build-version.inc - COMMENT "Update build-version.inc in the Shaderc build directory (if necessary).") -- + function(define_pkg_config_file NAME LIBS) add_custom_target(${NAME}-pkg-config ALL - COMMAND ${CMAKE_COMMAND} diff --git a/glslc/CMakeLists.txt b/glslc/CMakeLists.txt index acf6fb0..d0df7db 100644 --- a/glslc/CMakeLists.txt @@ -27,15 +26,3 @@ index acf6fb0..d0df7db 100644 shaderc_add_tests( TEST_PREFIX glslc -diff --git a/spvc/CMakeLists.txt b/spvc/CMakeLists.txt -index f465972..76f8c2e 100644 ---- a/spvc/CMakeLists.txt -+++ b/spvc/CMakeLists.txt -@@ -3,7 +3,6 @@ shaderc_default_compile_options(spvc_exe) - target_include_directories(spvc_exe PRIVATE ${shaderc_SOURCE_DIR}/libshaderc/include ${spirv-tools_SOURCE_DIR}/include) - set_target_properties(spvc_exe PROPERTIES OUTPUT_NAME spvc) - target_link_libraries(spvc_exe PRIVATE shaderc_spvc shaderc_util) --add_dependencies(spvc_exe build-version) - - shaderc_add_asciidoc(spvc_doc_README README) - diff --git a/ports/shaderc/fix-build-type.patch b/ports/shaderc/fix-build-type.patch index 959610e3b4..8e5cd22db1 100644 --- a/ports/shaderc/fix-build-type.patch +++ b/ports/shaderc/fix-build-type.patch @@ -1,85 +1,67 @@ diff --git a/libshaderc/CMakeLists.txt b/libshaderc/CMakeLists.txt -index 0ffa06f..3476170 100644 +index 3ada419..f3277f0 100644 --- a/libshaderc/CMakeLists.txt +++ b/libshaderc/CMakeLists.txt -@@ -10,10 +10,11 @@ set(SHADERC_SOURCES +@@ -24,13 +24,16 @@ set(SHADERC_SOURCES src/shaderc_private.h ) +if (NOT BUILD_SHARED_LIBS) add_library(shaderc STATIC ${SHADERC_SOURCES}) shaderc_default_compile_options(shaderc) - target_include_directories(shaderc PUBLIC include PRIVATE ${glslang_SOURCE_DIR}) -- + target_include_directories(shaderc + PUBLIC include + PRIVATE ${glslang_SOURCE_DIR} + ${SPIRV-Headers_SOURCE_DIR}/include) ++set(shaderc_install_target shaderc) + +else() add_library(shaderc_shared SHARED ${SHADERC_SOURCES}) shaderc_default_compile_options(shaderc_shared) - target_include_directories(shaderc_shared PUBLIC include PRIVATE ${glslang_SOURCE_DIR}) -@@ -22,6 +23,7 @@ target_compile_definitions(shaderc_shared + target_include_directories(shaderc_shared +@@ -42,6 +45,8 @@ target_compile_definitions(shaderc_shared PUBLIC SHADERC_SHAREDLIB ) set_target_properties(shaderc_shared PROPERTIES SOVERSION 1) ++set(shaderc_install_target shaderc_shared) +endif() if(SHADERC_ENABLE_INSTALL) install( -@@ -34,10 +36,17 @@ if(SHADERC_ENABLE_INSTALL) +@@ -54,7 +59,7 @@ if(SHADERC_ENABLE_INSTALL) DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/shaderc) - install(TARGETS shaderc shaderc_shared -+ if (NOT BUILD_SHARED_LIBS) -+ install(TARGETS shaderc -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ else() -+ install(TARGETS shaderc_shared ++ install(TARGETS ${shaderc_install_target} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ endif() - endif(SHADERC_ENABLE_INSTALL) - - find_package(Threads) -@@ -47,10 +56,13 @@ set(SHADERC_LIBS - SPIRV # from glslang +@@ -68,8 +73,11 @@ set(SHADERC_LIBS SPIRV-Tools ) -- -+if (NOT BUILD_SHARED_LIBS) + ++if(NOT BUILD_SHARED_LIBS) target_link_libraries(shaderc PRIVATE ${SHADERC_LIBS}) +else() target_link_libraries(shaderc_shared PRIVATE ${SHADERC_LIBS}) +endif() -+if (NOT BUILD_SHARED_LIBS) shaderc_add_tests( TEST_PREFIX shaderc - LINK_LIBS shaderc -@@ -60,7 +72,7 @@ shaderc_add_tests( - shaderc +@@ -93,6 +101,7 @@ shaderc_add_tests( shaderc_cpp shaderc_private) -- -+else() - shaderc_add_tests( - TEST_PREFIX shaderc_shared - LINK_LIBS shaderc_shared SPIRV-Tools -@@ -70,7 +82,9 @@ shaderc_add_tests( - shaderc - shaderc_cpp - shaderc_private) -- -+endif() -+# Do not combine all dependencies to static library -+if (0) + ++if(0) shaderc_combine_static_lib(shaderc_combined shaderc) if(SHADERC_ENABLE_INSTALL) -@@ -106,3 +120,4 @@ if(${SHADERC_ENABLE_TESTS}) - target_link_libraries(shaderc_c_smoke_test PRIVATE shaderc) - add_test(NAME shaderc_c_smoke_test COMMAND shaderc_c_smoke_test) - endif() +@@ -121,6 +130,7 @@ shaderc_add_tests( + TEST_NAMES + shaderc + shaderc_cpp) +endif() -\ No newline at end of file + + if(${SHADERC_ENABLE_TESTS}) + add_executable(shaderc_c_smoke_test ./src/shaderc_c_smoke_test.c) diff --git a/ports/shaderc/fix-install.patch b/ports/shaderc/fix-install.patch deleted file mode 100644 index 1857ed8fed..0000000000 --- a/ports/shaderc/fix-install.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/libshaderc/CMakeLists.txt b/libshaderc/CMakeLists.txt -index 9d07136..0ffa06f 100644 ---- a/libshaderc/CMakeLists.txt -+++ b/libshaderc/CMakeLists.txt -@@ -84,7 +84,7 @@ if(SHADERC_ENABLE_INSTALL) - # around this problem by manually substitution. - string(REPLACE "$(Configuration)" "\${CMAKE_INSTALL_CONFIG_NAME}" - install_location "${generated_location}") -- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${install_location} DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ install(FILES ${install_location} DESTINATION ${CMAKE_INSTALL_LIBDIR}) - else() - install(FILES ${generated_location} DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif() -diff --git a/libshaderc_spvc/CMakeLists.txt b/libshaderc_spvc/CMakeLists.txt -index fae235e..b503e70 100644 ---- a/libshaderc_spvc/CMakeLists.txt -+++ b/libshaderc_spvc/CMakeLists.txt -@@ -84,7 +84,7 @@ if(SHADERC_ENABLE_INSTALL) - # around this problem by manually substitution. - string(REPLACE "$(Configuration)" "\${CMAKE_INSTALL_CONFIG_NAME}" - install_location "${generated_location}") -- install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${install_location} DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ install(FILES ${install_location} DESTINATION ${CMAKE_INSTALL_LIBDIR}) - else() - install(FILES ${generated_location} DESTINATION ${CMAKE_INSTALL_LIBDIR}) - endif() diff --git a/ports/shaderc/glslang/CMakeLists.txt b/ports/shaderc/glslang/CMakeLists.txt new file mode 100644 index 0000000000..0e745779db --- /dev/null +++ b/ports/shaderc/glslang/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.11) + +find_package(glslang CONFIG REQUIRED) + +set_property(TARGET glslang PROPERTY IMPORTED_GLOBAL TRUE) +set_property(TARGET OSDependent PROPERTY IMPORTED_GLOBAL TRUE) +set_property(TARGET OGLCompiler PROPERTY IMPORTED_GLOBAL TRUE) +set_property(TARGET HLSL PROPERTY IMPORTED_GLOBAL TRUE) +set_property(TARGET SPIRV PROPERTY IMPORTED_GLOBAL TRUE) +set_property(TARGET MachineIndependent PROPERTY IMPORTED_GLOBAL TRUE) + +find_path(glslang_SOURCE_DIR glslang/Public/ShaderLang.h) +set(glslang_SOURCE_DIR "${glslang_SOURCE_DIR}/glslang" "${glslang_SOURCE_DIR}" CACHE STRING "" FORCE) diff --git a/ports/shaderc/portfile.cmake b/ports/shaderc/portfile.cmake index 40005d52bd..7d9596781c 100644 --- a/ports/shaderc/portfile.cmake +++ b/ports/shaderc/portfile.cmake @@ -4,20 +4,14 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO google/shaderc - REF 05c766a1f4615ee37d37d09271aaabca30ffd293 - SHA512 329697e8e23d619313440d57ef740a94c49d13533e1b8734fc8ff72fd5092c2addabb306f64cb69160fa5fee373a05ba39a5ee6d92d95e5e2e9c7ec96a51aadc + REF adca18dcadd460eb517fe44f6cd2460fa0650ebe + SHA512 3a27d4c51be9e9396b9a854cb96d88e78ff2ca6dcb8400bd3288f6984d25876af0eae649aa1c72ad613edbbcfa4324a12809f13ceb7a0134eef41cb1a698dfdf HEAD_REF master PATCHES disable-update-version.patch - fix-install.patch fix-build-type.patch ) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}/third_party/glslang) - -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) - file(COPY ${CMAKE_CURRENT_LIST_DIR}/build-version.inc DESTINATION ${SOURCE_PATH}/glslc/src) set(OPTIONS) @@ -36,12 +30,9 @@ vcpkg_configure_cmake( 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 + -DSHADERC_GLSLANG_DIR=${CMAKE_CURRENT_LIST_DIR}/glslang + -DSHADERC_SPIRV_TOOLS_DIR=${CMAKE_CURRENT_LIST_DIR}/spirv-tools + -DSHADERC_ENABLE_EXAMPLES=OFF ) vcpkg_install_cmake() diff --git a/ports/shaderc/CMakeLists_spirv.txt b/ports/shaderc/spirv-tools/CMakeLists.txt similarity index 100% rename from ports/shaderc/CMakeLists_spirv.txt rename to ports/shaderc/spirv-tools/CMakeLists.txt diff --git a/ports/shaderc/vcpkg.json b/ports/shaderc/vcpkg.json new file mode 100644 index 0000000000..9d7b57a131 --- /dev/null +++ b/ports/shaderc/vcpkg.json @@ -0,0 +1,10 @@ +{ + "name": "shaderc", + "version": "2021.1", + "description": "A collection of tools, libraries and tests for shader compilation.", + "homepage": "https://github.com/google/shaderc", + "dependencies": [ + "glslang", + "spirv-tools" + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 0ea6984335..0c9184aad8 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2333,8 +2333,8 @@ "port-version": 0 }, "glslang": { - "baseline": "2019-03-05", - "port-version": 3 + "baseline": "11.5.0", + "port-version": 0 }, "glui": { "baseline": "2019-11-30", @@ -5753,8 +5753,8 @@ "port-version": 0 }, "shaderc": { - "baseline": "2019-06-26", - "port-version": 2 + "baseline": "2021.1", + "port-version": 0 }, "shaderwriter": { "baseline": "1.1.0", diff --git a/versions/g-/glslang.json b/versions/g-/glslang.json index 1f1a95eaaf..9d0ddcbad9 100644 --- a/versions/g-/glslang.json +++ b/versions/g-/glslang.json @@ -1,9 +1,9 @@ { "versions": [ { - "git-tree": "a7d9b6a3d936d273c6b1966eb3b8fe8cb1ba28d1", - "version-string": "2019-03-05", - "port-version": 3 + "git-tree": "e1d95a78d1dee917b157cbdef0896ab7256ea637", + "version": "11.5.0", + "port-version": 0 }, { "git-tree": "29f2d736c8273c412c4fcf0fd50da379d1ec9a0b", diff --git a/versions/s-/shaderc.json b/versions/s-/shaderc.json index b58c9a2a80..6a07dae444 100644 --- a/versions/s-/shaderc.json +++ b/versions/s-/shaderc.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "2bf34bbfc26bddfe440bb115157a3b5cd07e7e79", + "version": "2021.1", + "port-version": 0 + }, { "git-tree": "684cc1ffce4fe1fe48788484436e1e6d5886859e", "version-string": "2019-06-26",