[directxtex] Update for March 2024 release (#37233)

In addition to updating for the latest release on GitHub, this adds
support for three new *features*:

* **jpeg** this adds JPEG support for Linux (Windows already supports
JPEG via the built-in WIC codec)
* **png** this adds PNG support for Linux (Windows already supports PNG
via the built-in WIC codec)
* **xbox** this builds the library for PC but with Xbox extensions for
development. Requires the Microsoft GDKX. By default it targets Xbox
Series X|S. To target Xbox One instead, you can use a triplet variable
as described in the update usage.
This commit is contained in:
Chuck Walbourn 2024-03-11 20:16:53 -07:00 committed by GitHub
parent c8f2fabe95
commit 2f29964660
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 53 additions and 6 deletions

View File

@ -1,4 +1,4 @@
set(DIRECTXTEX_TAG feb2024)
set(DIRECTXTEX_TAG mar2024)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
@ -6,7 +6,7 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Microsoft/DirectXTex
REF ${DIRECTXTEX_TAG}
SHA512 d82e722746409fccb831cdb85c28403b5e3bb9b60bdc6f80366096998265e009c13868bba9cf187ee10a09df3d6a1426777a1f181d733b61dfe0dffe72b56601
SHA512 313e66597a101675c9c32032577421ae574229d27defe718a94690446e9c562507209b5912ac48c6dc4d84124b059c9c061e094f44b0b9dbc90ede50d8a2c230
HEAD_REF main
)
@ -15,7 +15,9 @@ vcpkg_check_features(
FEATURES
dx11 BUILD_DX11
dx12 BUILD_DX12
jpeg ENABLE_LIBJPEG_SUPPORT
openexr ENABLE_OPENEXR_SUPPORT
png ENABLE_LIBPNG_SUPPORT
spectre ENABLE_SPECTRE_MITIGATION
tools BUILD_TOOLS
)
@ -27,7 +29,19 @@ if(VCPKG_TARGET_IS_WINDOWS AND NOT (VCPKG_TARGET_IS_XBOX OR VCPKG_TARGET_IS_MING
endif()
if(VCPKG_TARGET_IS_MINGW AND ("dx11" IN_LIST FEATURES))
message(NOTICE "Building ${PORT} for MinGW requires the HLSL Compiler fxc.exe also be in the PATH. See https://aka.ms/windowssdk.")
message(NOTICE "Building ${PORT} for MinGW requires the HLSL Compiler fxc.exe also be in the PATH. See https://aka.ms/windowssdk.")
endif()
if("xbox" IN_LIST FEATURES)
if((NOT (DEFINED DIRECTXTEX_XBOX_CONSOLE_TARGET)) OR (DIRECTXTEX_XBOX_CONSOLE_TARGET STREQUAL "scarlett"))
list(APPEND FEATURE_OPTIONS "-DBUILD_XBOX_EXTS_SCARLETT=ON")
message(NOTICE "Building ${PORT} with Xbox Series X|S extensions")
elseif(DIRECTXTEX_XBOX_CONSOLE_TARGET STREQUAL "xboxone")
list(APPEND FEATURE_OPTIONS "-DBUILD_XBOX_EXTS_XBOXONE=ON")
message(NOTICE "Building ${PORT} with Xbox One extensions")
else()
message(FATAL_ERROR "The triplet variable DIRECTXTEX_XBOX_CONSOLE_TARGET should be set to 'xboxone' or 'scarlett'.")
endif()
endif()
if (VCPKG_HOST_IS_LINUX)
@ -47,7 +61,7 @@ if("tools" IN_LIST FEATURES)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/directxtex/")
if((VCPKG_TARGET_ARCHITECTURE STREQUAL x64) AND (NOT ("openexr" IN_LIST FEATURES)))
if((VCPKG_TARGET_ARCHITECTURE STREQUAL x64) AND (NOT (("openexr" IN_LIST FEATURES) OR ("xbox" IN_LIST FEATURES))))
vcpkg_download_distfile(
TEXASSEMBLE_EXE

View File

@ -2,3 +2,10 @@ The DirectXTex package provides CMake targets:
find_package(directxtex CONFIG REQUIRED)
target_link_libraries(main PRIVATE Microsoft::DirectXTex)
For the 'xbox' feature, it defaults to targeting Xbox Series X|S. To set it to Xbox One,
create a custom triplet from x64-windows with the addition of the following:
if (PORT STREQUAL "directxtex")
set(DIRECTXTEX_XBOX_CONSOLE_TARGET "xboxone")
endif()

View File

@ -1,6 +1,6 @@
{
"name": "directxtex",
"version-date": "2024-02-21",
"version-date": "2024-03-06",
"description": "DirectXTex texture processing library",
"homepage": "https://github.com/Microsoft/DirectXTex",
"documentation": "https://github.com/microsoft/DirectXTex/wiki",
@ -41,18 +41,39 @@
}
]
},
"jpeg": {
"description": "Add the JPEG auxiliary functions",
"supports": "linux",
"dependencies": [
"libjpeg-turbo"
]
},
"openexr": {
"description": "Enable OpenEXR support",
"dependencies": [
"openexr"
]
},
"png": {
"description": "Add the PNG auxiliary functions",
"supports": "linux",
"dependencies": [
"libpng"
]
},
"spectre": {
"description": "Build Spectre-mitigated library"
},
"tools": {
"description": "texture command-line tools",
"supports": "windows & !uwp & !xbox"
},
"xbox": {
"description": "Adds Xbox specific extensions to the library",
"supports": "windows & x64 & !uwp & !xbox",
"dependencies": [
"ms-gdkx"
]
}
}
}

View File

@ -2225,7 +2225,7 @@
"port-version": 8
},
"directxtex": {
"baseline": "2024-02-21",
"baseline": "2024-03-06",
"port-version": 0
},
"directxtk": {

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "73c4c87bb25b805948428dfc2a9674ae0b7078fa",
"version-date": "2024-03-06",
"port-version": 0
},
{
"git-tree": "a2d746ba7bfd95fe762b07329b0cc6f05aea1808",
"version-date": "2024-02-21",