-
-
Notifications
You must be signed in to change notification settings - Fork 193
WIP: GRDK (Gaming.Desktop.x64) #1311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
jpnurmi
wants to merge
30
commits into
master
Choose a base branch
from
feat/grdk
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 29 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
0695563
WIP: GRDK (Gaming.Desktop.x64)
jpnurmi 6b101e4
cmake -G Visual Studio 17 2022 -A Gaming.Desktop.x64
jpnurmi 764bbe9
Cache GDK
jpnurmi c7e9c22
Add CMakeGDKDesktop.cmake
jpnurmi 0b321a7
add missing cache-gdk.outputs.cache-hit check
jpnurmi 5a15eae
pass GDK_VERSION
jpnurmi 2fec2a1
restore & save cache
jpnurmi afc6d3b
disable zlib
jpnurmi 18c6016
GDK_VERSION vs. GDK_WINGET_VERSION :(
jpnurmi 998587c
try forward slashes
jpnurmi 80a7a3d
adapt DIRECTX_DXC_TOOL from the others
jpnurmi 674f674
drop quotes
jpnurmi 57a1c5d
Revert "adapt DIRECTX_DXC_TOOL from the others"
jpnurmi 6ea7a95
DIRECTX_DXC_TOOL: drop REQUIRED
jpnurmi 14129d3
GDK vs. XBOX
jpnurmi f9f8592
check cache-gdk.outputs.cache-hit
jpnurmi cfdea92
comment out cache
jpnurmi afcd2dd
dbg
jpnurmi 17262ed
restore cache
jpnurmi e5513a6
fixup registry
jpnurmi d298015
setup gdk is win-only
jpnurmi 0d8bf69
fix skip_test
jpnurmi 2715d16
add SENTRY_PLATFORM_GDK
jpnurmi d4ccc7b
setup-gdk composite action
jpnurmi 4f637f3
respect CMAKE_DEFINES
jpnurmi dacc744
setup-gdk: restore/save cache
jpnurmi f11ad8c
fix actions/cache/restore
jpnurmi a2360f7
respect CMAKE_DEFINES
jpnurmi adb69c2
merge gdk caches
jpnurmi 8eba500
Update .github/actions/setup-gdk/action.yml
jpnurmi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Setup GDK | ||
description: Installs Microsoft.Gaming.GDK using WinGet | ||
inputs: | ||
gdk-version: | ||
description: GDK version to install (e.g. 2504.1.4046) | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Restore GDK | ||
id: cache-gdk | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: | | ||
C:/Program Files (x86)/Microsoft GDK | ||
C:/Program Files/Microsoft Visual Studio/2022/Enterprise/MSBuild/Microsoft/VC/v170/Platforms/Gaming.Desktop.x64 | ||
${{ runner.temp }}/gdk.reg | ||
key: setup-gdk-${{ inputs.gdk-version }} | ||
|
||
- name: Setup GDK | ||
if: ${{ steps.cache-gdk.outputs.cache-hit == 'true' }} | ||
shell: pwsh | ||
run: | | ||
reg import "$env:RUNNER_TEMP\gdk.reg" | ||
|
||
- name: Install GDK | ||
if: ${{ steps.cache-gdk.outputs.cache-hit != 'true' }} | ||
shell: pwsh | ||
run: | | ||
winget install --accept-source-agreements --accept-package-agreements --silent --disable-interactivity --version ${{ inputs.gdk-version }} Microsoft.Gaming.GDK | ||
reg export "HKLM\SOFTWARE\WOW6432Node\Microsoft\GDK" "$env:RUNNER_TEMP\gdk.reg" | ||
|
||
- name: Cache GDK | ||
if: ${{ steps.cache-gdk.outputs.cache-hit != 'true' }} | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: | | ||
C:/Program Files (x86)/Microsoft GDK | ||
C:/Program Files/Microsoft Visual Studio/2022/Enterprise/MSBuild/Microsoft/VC/v170/Platforms/Gaming.Desktop.x64 | ||
${{ runner.temp }}/gdk.reg | ||
key: setup-gdk-${{ inputs.gdk-version }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Adapted by Sentry from: | ||
# https://github.com/microsoft/Xbox-GDK-Samples/blob/710f4bd9095d3796d07505249a7b383857e8a23f/Samples/Tools/CMakeExample/CMake/CMakeGDKDesktop.cmake | ||
# | ||
# CMakeGDKDesktop.cmake : CMake definitions for Microsoft GDK targeting PC | ||
# | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
mark_as_advanced(CMAKE_TOOLCHAIN_FILE) | ||
|
||
if(_GDK_DESKTOP_TOOLCHAIN_) | ||
return() | ||
endif() | ||
|
||
#--- Microsoft Game Development Kit | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/DetectGDK.cmake") | ||
|
||
set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES GDK_VERSION BUILD_USING_BWOI) | ||
|
||
set(CMAKE_SYSTEM_NAME WINDOWS) | ||
set(CMAKE_SYSTEM_VERSION 10.0) | ||
|
||
#--- GameRuntime and Extension Libraries | ||
include(${CMAKE_CURRENT_LIST_DIR}/GDK-targets.cmake) | ||
|
||
message("Microsoft GDK = ${Console_SdkRoot}/${GDK_VERSION}") | ||
|
||
#--- Tools | ||
find_program(MAKEPKG_TOOL makepkg.exe | ||
REQUIRED NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH NO_DEFAULT_PATH | ||
HINTS "${Console_SdkRoot}/bin") | ||
|
||
message("MGC Tool = ${MAKEPKG_TOOL}") | ||
|
||
find_program(DIRECTX_DXC_TOOL dxc.exe) | ||
|
||
message("DXC Compiler = ${DIRECTX_DXC_TOOL}") | ||
|
||
set(_GDK_DESKTOP_TOOLCHAIN_ ON) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Adapted by Sentry from: | ||
# https://github.com/microsoft/Xbox-GDK-Samples/blob/710f4bd9095d3796d07505249a7b383857e8a23f/Samples/Tools/CMakeGDKExample/grdk_toolchain.cmake | ||
# | ||
# grdk_toolchain.cmake : CMake Toolchain file for Gaming.Desktop.x64 | ||
# | ||
# Copyright (c) Microsoft Corporation. | ||
# Licensed under the MIT License. | ||
|
||
mark_as_advanced(CMAKE_TOOLCHAIN_FILE) | ||
|
||
if(_GRDK_TOOLCHAIN_) | ||
return() | ||
endif() | ||
|
||
# Microsoft Game Development Kit | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/DetectGDK.cmake") | ||
|
||
set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES GDK_VERSION) | ||
|
||
set(CMAKE_SYSTEM_NAME WINDOWS) | ||
set(CMAKE_SYSTEM_VERSION 10.0) | ||
|
||
set(CMAKE_GENERATOR_PLATFORM "Gaming.Desktop.x64" CACHE STRING "" FORCE) | ||
set(CMAKE_VS_PLATFORM_NAME "Gaming.Desktop.x64" CACHE STRING "" FORCE) | ||
|
||
# Ensure our platform toolset is x64 | ||
set(CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE "x64" CACHE STRING "" FORCE) | ||
|
||
# Let the GDK MSBuild rules decide the WindowsTargetPlatformVersion | ||
set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION "" CACHE STRING "" FORCE) | ||
|
||
if(${CMAKE_VERSION} GREATER_EQUAL "3.30") | ||
set(CMAKE_VS_USE_DEBUG_LIBRARIES "$<CONFIG:Debug>" CACHE STRING "" FORCE) | ||
endif() | ||
|
||
# Sets platform defines | ||
set(CMAKE_CXX_FLAGS_INIT "$ENV{CFLAGS} ${CMAKE_CXX_FLAGS_INIT} -D_GAMING_DESKTOP -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP" CACHE STRING "" FORCE) | ||
|
||
# Add GDK props file | ||
file(GENERATE OUTPUT gdk_build.props INPUT ${CMAKE_CURRENT_LIST_DIR}/gdk_build.props) | ||
|
||
# Find DXC compiler | ||
if(NOT GDK_DXCTool) | ||
set(GDK_DXCTool "dxc.exe") | ||
mark_as_advanced(GDK_DXCTool) | ||
endif() | ||
|
||
# The MicrosoftGame.Config file needs to be in the directory with the project to enable deploy for Gaming.Desktop.x64 | ||
#file(GENERATE OUTPUT MicrosoftGame.Config INPUT ${CMAKE_CURRENT_LIST_DIR}/MicrosoftGameConfig.mgc) | ||
|
||
set(_GRDK_TOOLCHAIN_ ON) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.