Skip to content

Commit

Permalink
[directx-dxc, directx-headers] ports updated for December 2022 releas…
Browse files Browse the repository at this point in the history
…es (#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 <chuckw_walbourn@yahoo.com>
  • Loading branch information
walbourn and walbourn committed Jan 9, 2023
1 parent fe9b87a commit f14984a
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 38 deletions.
14 changes: 8 additions & 6 deletions ports/directx-dxc/directx-dxc-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
106 changes: 81 additions & 25 deletions ports/directx-dxc/portfile.cmake
Original file line number Diff line number Diff line change
@@ -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)
14 changes: 12 additions & 2 deletions ports/directx-dxc/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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
}
]
}
6 changes: 4 additions & 2 deletions ports/directx-headers/portfile.cmake
Original file line number Diff line number Diff line change
@@ -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
)

Expand Down
2 changes: 1 addition & 1 deletion ports/directx-headers/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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/",
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
5 changes: 5 additions & 0 deletions versions/d-/directx-dxc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "5d5118c4217f6ec298f348d694eb02b00558ef07",
"version-date": "2022-12-16",
"port-version": 0
},
{
"git-tree": "3a28201604813ea41d43456d40bdbea61af0db69",
"version-date": "2022-07-18",
Expand Down
5 changes: 5 additions & 0 deletions versions/d-/directx-headers.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "8e739e5fb68db3d2e372c5434891f6a3322313ea",
"version": "1.608.2",
"port-version": 0
},
{
"git-tree": "164c2675281e6d570c824a1403e458628d087ec1",
"version": "1.606.4",
Expand Down

0 comments on commit f14984a

Please sign in to comment.