Skip to content

Commit

Permalink
[community triplet] adds triplets for building for the Xbox platform (m…
Browse files Browse the repository at this point in the history
…icrosoft#29210)

* Try adding xbox triplets

* Update for Gaming Command Prompt usage

* Fix directxtk12 shaders for xbox

* Add toolchain for xbox

* Fix ports for feature builds

* Code review feedback

* More code review

* Code review

* WIN32_LEAN_AND_MEAN is too aggressive for many libs

* Normalize GDK variable paths

* Need to leave oldnames.lib as many libs use POSIX names

* More code review feedback

* Remove extra file

* Use of /DEFAULTLIB fixed 41 ports

* Code review feedback

* Added basic xbox supports expression

* Updates for xbox-aware ports

* Update for CMake fixes upstream

* Minor synatx fix

* Fix up merge issues

* Need directx-headers for linux

* Missed one port revision

* Removed VCPKG_TARGET_IS_XBOX from project scope after upstream fixes

* Update baseline

* License updates per github-actions bot

* Update baseline

* Update toolchain to support try_compile for GDK headers

* Update port numbers

* Update baseline

* Don't need directx-dxc for Xbox builds

* Update baseline

* Update hashes

* Code review

* Update baseline

* Refresh hashes for upstream fixes

* Update baseline

* Add ms-gdkx stub port

* Update baseline

* updated ms-gdkx with user-friendly output

* Update baseline

* Code review for the toolchain file

* Update directxkt12 hash

* Refresh baseline

* Update MSBuild integration to select proper triplet for GDK custom platforms

* Update CMake integration to select proper xbox triplet from XBOX_CONSOLE_TARGET

* vcpkg.targets update

* Code review feedback

* Update baseline

* Refresh baseline

* Code review for MSBuild

* Code review for xbox toolchain

* vcpkg.cmake codereview

---------

Co-authored-by: walbourn <[email protected]>
  • Loading branch information
walbourn and walbourn authored Mar 8, 2023
1 parent 54e3abf commit c1d764a
Show file tree
Hide file tree
Showing 54 changed files with 484 additions and 66 deletions.
5 changes: 4 additions & 1 deletion ports/d3dx12/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"name": "d3dx12",
"version-string": "may2021",
"port-version": 1,
"description": "The D3D12 Helper Library",
"homepage": "https://docs.microsoft.com/en-us/windows/win32/direct3d12/helper-structures-and-functions-for-d3d12"
"homepage": "https://docs.microsoft.com/en-us/windows/win32/direct3d12/helper-structures-and-functions-for-d3d12",
"license": "MIT",
"supports": "(windows & !xbox) | linux"
}
3 changes: 2 additions & 1 deletion ports/directx-dxc/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "directx-dxc",
"version-date": "2023-03-01",
"port-version": 1,
"description": "DirectX Shader Compiler (LLVM/Clang)",
"homepage": "https://github.com/microsoft/DirectXShaderCompiler",
"documentation": "https://github.com/microsoft/DirectXShaderCompiler/wiki",
"license": null,
"supports": "(windows & !arm32 & !uwp) | (linux & x64)",
"supports": "(windows & !arm32 & !uwp & !xbox) | (linux & x64)",
"dependencies": [
{
"name": "vcpkg-cmake",
Expand Down
3 changes: 2 additions & 1 deletion ports/directx-headers/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "directx-headers",
"version": "1.608.2",
"port-version": 1,
"description": "Official DirectX 12 Headers",
"homepage": "https://devblogs.microsoft.com/directx/",
"documentation": "https://devblogs.microsoft.com/directx/gettingstarted-dx12agility/",
"license": "MIT",
"supports": "windows | linux",
"supports": "(windows & !xbox) | linux",
"dependencies": [
{
"name": "vcpkg-cmake",
Expand Down
8 changes: 4 additions & 4 deletions ports/directxmesh/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Microsoft/DirectXMesh
REF ${DIRECTXMESH_TAG}
SHA512 9a3f76b956b002ec0bd943746fe896348c2095c113d4b78efe257f3bc32af4995f4b33d5b13dad48798e706066c55acbbe4de5809240b052983ef322998f7734
REF dec2022b
SHA512 8e7b757b311223b6ea10fcd6ca9729a4fed51526966239da7d9c3c22f09bc50bbae80b2f8f899badbcc0bfcabc62dcd8d7a662c5881118cce97d3198c014c51e
HEAD_REF main
)

Expand All @@ -23,7 +23,7 @@ endif()

set(EXTRA_OPTIONS -DBUILD_TESTING=OFF)

if(VCPKG_TARGET_IS_UWP)
if(VCPKG_TARGET_IS_UWP OR VCPKG_TARGET_IS_XBOX)
list(APPEND EXTRA_OPTIONS -DBUILD_TOOLS=OFF)
else()
list(APPEND EXTRA_OPTIONS -DBUILD_TOOLS=ON)
Expand Down Expand Up @@ -53,7 +53,7 @@ if((VCPKG_HOST_IS_WINDOWS) AND (VCPKG_TARGET_ARCHITECTURE MATCHES x64))

file(RENAME ${CURRENT_PACKAGES_DIR}/tools/directxmesh/meshconvert-${DIRECTXMESH_TAG}.exe ${CURRENT_PACKAGES_DIR}/tools/directxmesh/meshconvert.exe)

elseif((VCPKG_TARGET_IS_WINDOWS) AND (NOT VCPKG_TARGET_IS_UWP))
elseif(VCPKG_TARGET_IS_WINDOWS AND (NOT VCPKG_TARGET_IS_UWP) AND (NOT VCPKG_TARGET_IS_XBOX))

vcpkg_copy_tools(
TOOL_NAMES meshconvert
Expand Down
10 changes: 9 additions & 1 deletion ports/directxmesh/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
{
"name": "directxmesh",
"version-date": "2022-12-15",
"port-version": 1,
"description": "DirectXMesh geometry processing library",
"homepage": "https://github.com/Microsoft/DirectXMesh",
"documentation": "https://github.com/microsoft/DirectXMesh/wiki",
"license": "MIT",
"supports": "windows | linux",
"dependencies": [
"directx-headers",
{
"name": "directx-headers",
"platform": "(windows & !xbox) | linux"
},
"directxmath",
{
"name": "ms-gdkx",
"platform": "xbox"
},
{
"name": "vcpkg-cmake",
"host": true
Expand Down
5 changes: 3 additions & 2 deletions ports/directxsdk/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "directxsdk",
"version-string": "jun10",
"port-version": 5,
"port-version": 6,
"description": "Legacy DirectX SDK",
"homepage": "https://docs.microsoft.com/en-us/windows/win32/directx-sdk--august-2009-",
"supports": "windows & !uwp & !arm",
"license": null,
"supports": "windows & !uwp & !xbox & !arm",
"features": {
"xaudio2-7": {
"description": "Include headers/libs for legacy XAudio 2.7 (prefer use of XAudio2Redist)"
Expand Down
8 changes: 4 additions & 4 deletions ports/directxtex/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Microsoft/DirectXTex
REF jan2023b
SHA512 5e107b1bbf2af8c9989e7760f9f8454b1fc956fb948003f92a7cec2954917cecb7d0fb5d076c3f920c57af7c45ca1b7b440acf1cbfd6de8bb57e8d50118df4de
REF jan2023c
SHA512 df550651b0fc4927aa9f837e0347b98722b8112ca7d7eddecded03a4a8a3dd7afed42c882c04f0b64e403a26c84d4e1c88ee9c104395be446ce220b28c6af9da
HEAD_REF main
)

Expand All @@ -29,7 +29,7 @@ endif()

set(EXTRA_OPTIONS -DBUILD_SAMPLE=OFF -DBUILD_TESTING=OFF -DBC_USE_OPENMP=ON)

if(VCPKG_TARGET_IS_UWP)
if(VCPKG_TARGET_IS_UWP OR VCPKG_TARGET_IS_XBOX)
list(APPEND EXTRA_OPTIONS -DBUILD_TOOLS=OFF)
else()
list(APPEND EXTRA_OPTIONS -DBUILD_TOOLS=ON)
Expand Down Expand Up @@ -77,7 +77,7 @@ if(VCPKG_HOST_IS_WINDOWS AND (VCPKG_TARGET_ARCHITECTURE MATCHES x64) AND (NOT ("
file(RENAME "${CURRENT_PACKAGES_DIR}/tools/directxtex/texconv-${DIRECTXTEX_TAG}.exe" "${CURRENT_PACKAGES_DIR}/tools/directxtex/texconv.exe")
file(RENAME "${CURRENT_PACKAGES_DIR}/tools/directxtex/texdiag-${DIRECTXTEX_TAG}.exe" "${CURRENT_PACKAGES_DIR}/tools/directxtex/texadiag.exe")

elseif(VCPKG_TARGET_IS_WINDOWS AND (NOT VCPKG_TARGET_IS_UWP) AND ("dx11" IN_LIST FEATURES))
elseif(VCPKG_TARGET_IS_WINDOWS AND (NOT VCPKG_TARGET_IS_UWP) AND (NOT VCPKG_TARGET_IS_XBOX) AND ("dx11" IN_LIST FEATURES))

vcpkg_copy_tools(
TOOL_NAMES texassemble texconv texdiag
Expand Down
11 changes: 9 additions & 2 deletions ports/directxtex/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
{
"name": "directxtex",
"version-date": "2023-01-31",
"port-version": 1,
"port-version": 2,
"description": "DirectXTex texture processing library",
"homepage": "https://github.com/Microsoft/DirectXTex",
"documentation": "https://github.com/microsoft/DirectXTex/wiki",
"license": "MIT",
"supports": "windows | linux",
"dependencies": [
"directx-headers",
{
"name": "directx-headers",
"platform": "(windows & !xbox) | linux"
},
"directxmath",
{
"name": "ms-gdkx",
"platform": "xbox"
},
{
"name": "vcpkg-cmake",
"host": true
Expand Down
4 changes: 2 additions & 2 deletions ports/directxtk/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Microsoft/DirectXTK
REF ${DIRECTXTK_TAG}
SHA512 229f51e60937aacf0826d02e4c0869f2801e897efbacd9a2cab6f816c1218903d7dae654ab1ab42678bb2adf98b98d303886f3d51f6642d81b7350297e81068d
REF feb2023b
SHA512 ada04322589e635a7fc21a3b35e9af676bba060a800b56b2735e7e109801b08daa9f9ef8b6b25762e470a88a9cb0fdab3cb46dcc7b13e0344ded4d507254ea37
HEAD_REF main
)

Expand Down
3 changes: 2 additions & 1 deletion ports/directxtk/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "directxtk",
"version-date": "2023-02-06",
"port-version": 1,
"description": "A collection of helper classes for writing DirectX 11.x code in C++.",
"homepage": "https://github.com/Microsoft/DirectXTK",
"documentation": "https://github.com/microsoft/DirectXTK/wiki",
"license": "MIT",
"supports": "windows",
"supports": "windows & !xbox",
"dependencies": [
"directxmath",
{
Expand Down
14 changes: 10 additions & 4 deletions ports/directxtk12/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Microsoft/DirectXTK12
REF ${DIRECTXTK_TAG}
SHA512 e536e5c258266e46b31a5c7af46a70cc8428e71dc495015527a710ccbfc87fc349caeb7ffcf8cfc1ec2a3311eac55ad30ab906cc4abeacb55b63427e2d514e83
REF feb2023b
SHA512 e17b726e8f73bd499ab0c7e9c1d8fb7f1af3bad3220a8b3accbf5993b735bcd7caa349b767d09af74a800e0cf1852749280fc0e7a0cf8fe186dbf13dd07ba11d
HEAD_REF main
)

Expand All @@ -18,10 +18,16 @@ vcpkg_check_features(
xaudio2redist BUILD_XAUDIO_REDIST
)

set(DXCPATH ${CURRENT_HOST_INSTALLED_DIR}/tools/directx-dxc)
set(EXTRA_OPTIONS -DBUILD_TESTING=OFF)

if(NOT VCPKG_TARGET_IS_XBOX)
set(DXCPATH "${CURRENT_HOST_INSTALLED_DIR}/tools/directx-dxc")
list(APPEND EXTRA_OPTIONS -DBUILD_DXIL_SHADERS=ON "-DDIRECTX_DXC_PATH=${DXCPATH}")
endif()

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS ${FEATURE_OPTIONS} -DBUILD_TESTING=OFF -DBUILD_DXIL_SHADERS=ON -DDIRECTX_DXC_PATH=${DXCPATH}
OPTIONS ${FEATURE_OPTIONS} ${EXTRA_OPTIONS}
)

vcpkg_cmake_install()
Expand Down
13 changes: 11 additions & 2 deletions ports/directxtk12/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "directxtk12",
"version-date": "2023-02-06",
"port-version": 1,
"description": "A collection of helper classes for writing DirectX 12 code in C++.",
"homepage": "https://github.com/Microsoft/DirectXTK12",
"documentation": "https://github.com/microsoft/DirectXTK12/wiki",
Expand All @@ -9,10 +10,18 @@
"dependencies": [
{
"name": "directx-dxc",
"host": true
"host": true,
"platform": "windows & !xbox"
},
{
"name": "directx-headers",
"platform": "windows & !xbox"
},
"directx-headers",
"directxmath",
{
"name": "ms-gdkx",
"platform": "xbox"
},
{
"name": "vcpkg-cmake",
"host": true
Expand Down
4 changes: 2 additions & 2 deletions ports/dstorage/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "dstorage",
"version": "1.1.0",
"port-version": 1,
"port-version": 2,
"description": "DirectStorage for Windows",
"homepage": "https://aka.ms/directstorage/",
"documentation": "https://github.com/microsoft/DirectStorage",
"license": null,
"supports": "windows & !uwp & !staticcrt"
"supports": "windows & !uwp & !xbox & !staticcrt"
}
4 changes: 2 additions & 2 deletions ports/dxsdk-d3dx/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "dxsdk-d3dx",
"version": "9.29.952.8",
"port-version": 4,
"port-version": 5,
"description": "Redistributable package for the legacy DirectX SDK's D3DX9, D3DX10, and/or D3DX11 utility libraries.",
"homepage": "https://walbourn.github.io/legacy-d3dx-on-nuget/",
"license": null,
"supports": "windows & !arm & !uwp & !staticcrt"
"supports": "windows & !arm & !uwp & !xbox & !staticcrt"
}
4 changes: 2 additions & 2 deletions ports/dxut/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "dxut",
"version": "11.31",
"port-version": 1,
"port-version": 2,
"description": "A \"GLUT\"-like framework for Direct3D 11.x Win32 desktop applications",
"homepage": "https://github.com/Microsoft/DXUT",
"documentation": "https://github.com/microsoft/DXUT/wiki",
"license": "MIT",
"supports": "windows & !uwp",
"supports": "windows & !uwp & !xbox",
"dependencies": [
"directxmath",
{
Expand Down
4 changes: 2 additions & 2 deletions ports/effects11/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "effects11",
"version": "11.29",
"port-version": 1,
"port-version": 2,
"description": "Effects for Direct3D 11 (FX11) is a management runtime for authoring HLSL shaders, render state, and runtime variables together.",
"homepage": "https://github.com/Microsoft/FX11",
"documentation": "https://github.com/microsoft/FX11/wiki",
"license": "MIT",
"supports": "windows & !mingw",
"supports": "windows & !xbox & !mingw",
"dependencies": [
{
"name": "vcpkg-cmake",
Expand Down
30 changes: 30 additions & 0 deletions ports/ms-gdkx/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
cmake_path(SET GRDKLatest "$ENV{GRDKLatest}")

find_path(GRDK_H
NAMES grdk.h
PATHS "${GRDKLatest}/gameKit/Include"
)

cmake_path(SET GXDKLatest "$ENV{GXDKLatest}")

find_path(GXDK_H
NAMES gxdk.h
PATHS "${GXDKLatest}/gameKit/Include"
)

if(NOT (GRDK_H AND GXDK_H))
message(FATAL_ERROR "Ensure you have installed the Microsoft GDK with Xbox Extensions installed. See https://aka.ms/gdkx.")
endif()

# Output user-friendly status message for installed edition.
if(${GXDKLatest} MATCHES ".*/([0-9][0-9])([0-9][0-9])([0-9][0-9])/.*")
set(_months "null" "January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December")
list(GET _months ${CMAKE_MATCH_2} month)
set(update "")
if(${CMAKE_MATCH_3} GREATER 0)
set(update " Update ${CMAKE_MATCH_3}")
endif()
message(STATUS "Found the Microsoft GDK with Xbox Extensions (${month} 20${CMAKE_MATCH_1}${update})")
endif()

SET(VCPKG_POLICY_EMPTY_PACKAGE enabled)
9 changes: 9 additions & 0 deletions ports/ms-gdkx/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "ms-gdkx",
"version": "1.0.0",
"description": "Stub port that ensures the Microsoft GDK with Xbox Extensions is installed.",
"homepage": "https://aka.ms/gdkx",
"documentation": "https://aka.ms/gamedevdocs",
"license": null,
"supports": "xbox"
}
2 changes: 2 additions & 0 deletions ports/opengl-registry/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"name": "opengl-registry",
"version-date": "2022-09-29",
"port-version": 1,
"description": "the API and Extension registries for the OpenGL family APIs",
"homepage": "https://github.com/KhronosGroup/OpenGL-Registry",
"supports": "!xbox",
"dependencies": [
"egl-registry"
]
Expand Down
3 changes: 2 additions & 1 deletion ports/opengl/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "opengl",
"version-date": "2022-12-04",
"port-version": 1,
"port-version": 2,
"description": "Open Graphics Library (OpenGL)[3][4][5] is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics.",
"license": null,
"supports": "!xbox",
"dependencies": [
"opengl-registry"
]
Expand Down
8 changes: 4 additions & 4 deletions ports/uvatlas/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Microsoft/UVAtlas
REF ${UVATLAS_TAG}
SHA512 cc44334fe2a372afd8bfa9c508fe59e6b68a3513ab92c0e3fe5657b539641faaa50625a3aafd65d3cb2023a167bfb7158f6b9ac7262d120fe97d48eb3a3742f5
REF feb2023b
SHA512 4780c6a7f33b7d659e8dd39f48d6adefd22b1a4ed4ff41a1f74614f05048dfed643235d13064a84bd6839642baf9eb7f55f0a8d68db0fb655b7652a7e914fde8
HEAD_REF main
PATCHES openexr.patch
)
Expand All @@ -24,7 +24,7 @@ vcpkg_check_features(

set(EXTRA_OPTIONS -DBUILD_TESTING=OFF)

if(VCPKG_TARGET_IS_UWP)
if(VCPKG_TARGET_IS_UWP OR VCPKG_TARGET_IS_XBOX)
list(APPEND EXTRA_OPTIONS -DBUILD_TOOLS=OFF)
else()
list(APPEND EXTRA_OPTIONS -DBUILD_TOOLS=ON)
Expand Down Expand Up @@ -54,7 +54,7 @@ if(VCPKG_HOST_IS_WINDOWS AND (VCPKG_TARGET_ARCHITECTURE MATCHES x64) AND (NOT ("

file(RENAME ${CURRENT_PACKAGES_DIR}/tools/uvatlas/uvatlastool-${UVATLAS_TAG}.exe ${CURRENT_PACKAGES_DIR}/tools/uvatlas/uvatlastool.exe)

elseif(VCPKG_TARGET_IS_WINDOWS AND (NOT VCPKG_TARGET_IS_UWP))
elseif(VCPKG_TARGET_IS_WINDOWS AND (NOT VCPKG_TARGET_IS_UWP) AND (NOT VCPKG_TARGET_IS_XBOX))

vcpkg_copy_tools(
TOOL_NAMES uvatlastool
Expand Down
Loading

0 comments on commit c1d764a

Please sign in to comment.