Skip to content

Commit

Permalink
[directxtex] Update for March 2024 release (#37233)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
walbourn committed Mar 12, 2024
1 parent c8f2fab commit 2f29964
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 6 deletions.
22 changes: 18 additions & 4 deletions ports/directxtex/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
set(DIRECTXTEX_TAG feb2024)
set(DIRECTXTEX_TAG mar2024)

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Microsoft/DirectXTex
REF ${DIRECTXTEX_TAG}
SHA512 d82e722746409fccb831cdb85c28403b5e3bb9b60bdc6f80366096998265e009c13868bba9cf187ee10a09df3d6a1426777a1f181d733b61dfe0dffe72b56601
SHA512 313e66597a101675c9c32032577421ae574229d27defe718a94690446e9c562507209b5912ac48c6dc4d84124b059c9c061e094f44b0b9dbc90ede50d8a2c230
HEAD_REF main
)

Expand All @@ -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
)
Expand All @@ -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)
Expand All @@ -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
Expand Down
7 changes: 7 additions & 0 deletions ports/directxtex/usage
Original file line number Diff line number Diff line change
Expand Up @@ -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()
23 changes: 22 additions & 1 deletion ports/directxtex/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"
]
}
}
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2225,7 +2225,7 @@
"port-version": 8
},
"directxtex": {
"baseline": "2024-02-21",
"baseline": "2024-03-06",
"port-version": 0
},
"directxtk": {
Expand Down
5 changes: 5 additions & 0 deletions versions/d-/directxtex.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "73c4c87bb25b805948428dfc2a9674ae0b7078fa",
"version-date": "2024-03-06",
"port-version": 0
},
{
"git-tree": "a2d746ba7bfd95fe762b07329b0cc6f05aea1808",
"version-date": "2024-02-21",
Expand Down

0 comments on commit 2f29964

Please sign in to comment.