From f14984af3738e69f197bf0e647a8dca12de92996 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Mon, 9 Jan 2023 01:24:11 -0800 Subject: [PATCH] [directx-dxc, directx-headers] ports updated for December 2022 releases (#28780) * [directx-dxc, directx-headers] updated for December 2022 releases * Add WSL support to directx-dxc * Update targets file * [directx-headers] upstream hotfix for WSL compat issue * Fix-up for WSL header placement * Update baseline * github actions code review * update baseline Co-authored-by: walbourn --- ports/directx-dxc/directx-dxc-config.cmake.in | 14 ++- ports/directx-dxc/portfile.cmake | 106 +++++++++++++----- ports/directx-dxc/vcpkg.json | 14 ++- ports/directx-headers/portfile.cmake | 6 +- ports/directx-headers/vcpkg.json | 2 +- versions/baseline.json | 4 +- versions/d-/directx-dxc.json | 5 + versions/d-/directx-headers.json | 5 + 8 files changed, 118 insertions(+), 38 deletions(-) diff --git a/ports/directx-dxc/directx-dxc-config.cmake.in b/ports/directx-dxc/directx-dxc-config.cmake.in index bf8c7cebcbc9af..2a35c8dfa8e0ec 100644 --- a/ports/directx-dxc/directx-dxc-config.cmake.in +++ b/ports/directx-dxc/directx-dxc-config.cmake.in @@ -3,16 +3,18 @@ get_filename_component(_dxc_root "${CMAKE_CURRENT_LIST_FILE}" PATH) get_filename_component(_dxc_root "${_dxc_root}" PATH) get_filename_component(_dxc_root "${_dxc_root}" PATH) -set(_dxc_exe "${_dxc_root}/tools/directx-dxc/dxc.exe") +set(_dxc_exe "${_dxc_root}/@tool_path@") if (EXISTS "${_dxc_exe}") add_library(Microsoft::DirectXShaderCompiler SHARED IMPORTED) set_target_properties(Microsoft::DirectXShaderCompiler PROPERTIES - IMPORTED_LOCATION_RELEASE "${_dxc_root}/bin/dxcompiler.dll" - IMPORTED_LOCATION_DEBUG "${_dxc_root}/bin/dxcompiler.dll" - IMPORTED_IMPLIB_RELEASE "${_dxc_root}/lib/dxcompiler.lib" - IMPORTED_IMPLIB_DEBUG "${_dxc_root}/lib/dxcompiler.lib" - INTERFACE_INCLUDE_DIRECTORIES "${_dxc_root}/include" + IMPORTED_LOCATION_RELEASE "${_dxc_root}/@dll_dir@/@dll_name@" + IMPORTED_LOCATION_DEBUG "${_dxc_root}/@dll_dir@/@dll_name@" + IMPORTED_IMPLIB_RELEASE "${_dxc_root}/lib/@lib_name@" + IMPORTED_IMPLIB_DEBUG "${_dxc_root}/lib/@lib_name@" + IMPORTED_SONAME_RELEASE "@lib_name@" + IMPORTED_SONAME_DEBUG "@lib_name@" + INTERFACE_INCLUDE_DIRECTORIES "${_dxc_root}/include/directx-dxc" IMPORTED_CONFIGURATIONS "Debug;Release" IMPORTED_LINK_INTERFACE_LANGUAGES "C") diff --git a/ports/directx-dxc/portfile.cmake b/ports/directx-dxc/portfile.cmake index 22251e30dc5358..d594e91d05a996 100644 --- a/ports/directx-dxc/portfile.cmake +++ b/ports/directx-dxc/portfile.cmake @@ -1,52 +1,108 @@ -vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) +set(VCPKG_POLICY_DLLS_IN_STATIC_LIBRARY enabled) -vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/microsoft/DirectXShaderCompiler/releases/download/v1.7.2207/dxc_2022_07_18.zip" - FILENAME "dxc_2022_07_18.zip" - SHA512 b34d770ed9299e6a9ade12cd8d9add28f50e41abdfcdbc7e272568d7f78fe5a8f2bbe5f905839981b97d34b52e1fa627ceacd55743f2cf71e39861418b11ae3b -) +if (NOT VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + message(STATUS "Note: ${PORT} always requires dynamic library linkage at runtime.") +endif() + +if (VCPKG_TARGET_IS_LINUX) + vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/microsoft/DirectXShaderCompiler/releases/download/v1.7.2212/linux_dxc_2022_12_16.tar.gz" + FILENAME "linux_dxc_2022_12_16.tar.gz" + SHA512 396d16a8a201bfad1531a984e78d59b918fac062a707697c27acb43257755a16899b7c4b68e2f5e35fbdf37c984b0c6029160be91fa37b32c0b4ea2d1c25277e + ) +else() + vcpkg_download_distfile(ARCHIVE + URLS "https://github.com/microsoft/DirectXShaderCompiler/releases/download/v1.7.2212/dxc_2022_12_16.zip" + FILENAME "dxc_2022_12_16.zip" + SHA512 b4885bdec0db5b6385d4a8c06617051b1777002c3f39bfcf4c9d2c95e9491634f0e77a18375bf5be5152136c5f509a94e3b4a9c56d2e844316e8b760b6acaf68 + ) +endif() vcpkg_download_distfile( LICENSE_TXT - URLS "https://raw.githubusercontent.com/microsoft/DirectXShaderCompiler/v1.7.2207/LICENSE.TXT" - FILENAME "LICENSE.v1.7.2207" + URLS "https://raw.githubusercontent.com/microsoft/DirectXShaderCompiler/v1.7.2212/LICENSE.TXT" + FILENAME "LICENSE.v1.7.2212" SHA512 7589f152ebc3296dca1c73609a2a23a911b8fc0029731268a6151710014d82005a868c85c8249219f060f64ab1ddecdddff5ed6ea34ff509f63ea3e42bbbf47e ) -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH PACKAGE_PATH +vcpkg_extract_source_archive( + PACKAGE_PATH ARCHIVE ${ARCHIVE} NO_REMOVE_ONE_LEVEL ) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") set(DXC_ARCH arm64) +elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") + set(DXC_ARCH x86) else() set(DXC_ARCH x64) endif() -file(INSTALL "${PACKAGE_PATH}/inc/d3d12shader.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/${PORT}") -file(INSTALL "${PACKAGE_PATH}/inc/dxcapi.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/${PORT}") +file(INSTALL + "${PACKAGE_PATH}/inc/dxcapi.h" + "${PACKAGE_PATH}/inc/dxcerrors.h" + "${PACKAGE_PATH}/inc/dxcisense.h" + DESTINATION "${CURRENT_PACKAGES_DIR}/include/${PORT}") -file(INSTALL "${PACKAGE_PATH}/lib/${DXC_ARCH}/dxcompiler.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") -file(INSTALL "${PACKAGE_PATH}/lib/${DXC_ARCH}/dxcompiler.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") +if (VCPKG_TARGET_IS_LINUX) -file(COPY "${PACKAGE_PATH}/bin/${DXC_ARCH}/dxcompiler.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/bin") -file(COPY "${PACKAGE_PATH}/bin/${DXC_ARCH}/dxcompiler.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin") + # Work around for https://github.com/microsoft/DirectXShaderCompiler/issues/4918 + file(COPY "${PACKAGE_PATH}/inc/WinAdapter.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/${PORT}/dxc/Support") + file(COPY "${PACKAGE_PATH}/inc/WinAdapter.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/${PORT}/Support") -file(COPY "${PACKAGE_PATH}/bin/${DXC_ARCH}/dxil.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/bin") -file(COPY "${PACKAGE_PATH}/bin/${DXC_ARCH}/dxil.dll" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin") + file(INSTALL + "${PACKAGE_PATH}/lib/${DXC_ARCH}/libdxcompiler.so" + "${PACKAGE_PATH}/lib/${DXC_ARCH}/libdxil.so" + DESTINATION "${CURRENT_PACKAGES_DIR}/lib") + file(INSTALL + "${PACKAGE_PATH}/lib/${DXC_ARCH}/libdxcompiler.so" + "${PACKAGE_PATH}/lib/${DXC_ARCH}/libdxil.so" + DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") -file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}/") + file(INSTALL + "${PACKAGE_PATH}/bin/${DXC_ARCH}/dxc" + DESTINATION "${CURRENT_PACKAGES_DIR}/bin") -file(INSTALL - "${PACKAGE_PATH}/bin/${DXC_ARCH}/dxc.exe" - "${PACKAGE_PATH}/bin/${DXC_ARCH}/dxcompiler.dll" - "${PACKAGE_PATH}/bin/${DXC_ARCH}/dxil.dll" - DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/") + set(dll_name "libdxcompiler.so") + set(dll_dir "lib") + set(lib_name "libdxcompiler.so") + set(tool_path "bin/dxc") +else() + # VCPKG_TARGET_IS_WINDOWS + + file(INSTALL "${PACKAGE_PATH}/inc/d3d12shader.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/${PORT}") + + file(INSTALL "${PACKAGE_PATH}/lib/${DXC_ARCH}/dxcompiler.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib") + file(INSTALL "${PACKAGE_PATH}/lib/${DXC_ARCH}/dxcompiler.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib") + + file(INSTALL + "${PACKAGE_PATH}/bin/${DXC_ARCH}/dxcompiler.dll" + "${PACKAGE_PATH}/bin/${DXC_ARCH}/dxil.dll" + DESTINATION "${CURRENT_PACKAGES_DIR}/bin") + file(INSTALL + "${PACKAGE_PATH}/bin/${DXC_ARCH}/dxcompiler.dll" + "${PACKAGE_PATH}/bin/${DXC_ARCH}/dxil.dll" + DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin") + + file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}/") + + file(INSTALL + "${PACKAGE_PATH}/bin/${DXC_ARCH}/dxc.exe" + "${PACKAGE_PATH}/bin/${DXC_ARCH}/dxcompiler.dll" + "${PACKAGE_PATH}/bin/${DXC_ARCH}/dxil.dll" + DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/") + + set(dll_name "dxcompiler.dll") + set(dll_dir "bin") + set(lib_name "dxcompiler.lib") + set(tool_path "tools/directx-dxc/dxc.exe") +endif() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") file(INSTALL "${LICENSE_TXT}" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) -configure_file("${CMAKE_CURRENT_LIST_DIR}/directx-dxc-config.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/${PORT}-config.cmake" COPYONLY) +configure_file("${CMAKE_CURRENT_LIST_DIR}/directx-dxc-config.cmake.in" + "${CURRENT_PACKAGES_DIR}/share/${PORT}/${PORT}-config.cmake" + @ONLY) diff --git a/ports/directx-dxc/vcpkg.json b/ports/directx-dxc/vcpkg.json index 3f86fd8a38c4d1..565f5a168018a1 100644 --- a/ports/directx-dxc/vcpkg.json +++ b/ports/directx-dxc/vcpkg.json @@ -1,9 +1,19 @@ { "name": "directx-dxc", - "version-date": "2022-07-18", + "version-date": "2022-12-16", "description": "DirectX Shader Compiler (LLVM/Clang)", "homepage": "https://github.com/microsoft/DirectXShaderCompiler", "documentation": "https://github.com/microsoft/DirectXShaderCompiler/wiki", "license": null, - "supports": "windows & (x64 | arm64) & !uwp & !staticcrt" + "supports": "(windows & !arm32 & !uwp) | (linux & x64)", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] } diff --git a/ports/directx-headers/portfile.cmake b/ports/directx-headers/portfile.cmake index c96fccbca7864c..0c781650eb7362 100644 --- a/ports/directx-headers/portfile.cmake +++ b/ports/directx-headers/portfile.cmake @@ -1,8 +1,10 @@ +vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION} + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Microsoft/DirectX-Headers - REF v1.606.4 - SHA512 3fb4142f8ceedd8484f5f7dae5804a7a0012951de344936fbf22991d6ae659d4e5093e1627bfe51c3cb0859340b13171c4f6aa68377ec26ac05038acaad8c540 + REF v1.608.2b + SHA512 d4e82615751d9ee46c456c676bfd6831c47d159ee58634531fc1acd09927f00c4e8d379cb233a1f89e3489a6a30d8edc0552b76945071badaed6a9c8591cbb0c HEAD_REF main ) diff --git a/ports/directx-headers/vcpkg.json b/ports/directx-headers/vcpkg.json index c6720af204b937..c382d88f46d12b 100644 --- a/ports/directx-headers/vcpkg.json +++ b/ports/directx-headers/vcpkg.json @@ -1,6 +1,6 @@ { "name": "directx-headers", - "version": "1.606.4", + "version": "1.608.2", "description": "Official DirectX 12 Headers", "homepage": "https://devblogs.microsoft.com/directx/", "documentation": "https://devblogs.microsoft.com/directx/gettingstarted-dx12agility/", diff --git a/versions/baseline.json b/versions/baseline.json index 3229d01810051e..25cfa50e6dc6b2 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1945,11 +1945,11 @@ "port-version": 3 }, "directx-dxc": { - "baseline": "2022-07-18", + "baseline": "2022-12-16", "port-version": 0 }, "directx-headers": { - "baseline": "1.606.4", + "baseline": "1.608.2", "port-version": 0 }, "directxmath": { diff --git a/versions/d-/directx-dxc.json b/versions/d-/directx-dxc.json index 5af87edbbef4b7..9ac5133de095f2 100644 --- a/versions/d-/directx-dxc.json +++ b/versions/d-/directx-dxc.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "5d5118c4217f6ec298f348d694eb02b00558ef07", + "version-date": "2022-12-16", + "port-version": 0 + }, { "git-tree": "3a28201604813ea41d43456d40bdbea61af0db69", "version-date": "2022-07-18", diff --git a/versions/d-/directx-headers.json b/versions/d-/directx-headers.json index 6d6e9a25eb307a..00e36223f297fc 100644 --- a/versions/d-/directx-headers.json +++ b/versions/d-/directx-headers.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "8e739e5fb68db3d2e372c5434891f6a3322313ea", + "version": "1.608.2", + "port-version": 0 + }, { "git-tree": "164c2675281e6d570c824a1403e458628d087ec1", "version": "1.606.4",