diff --git a/.gitignore b/.gitignore index 8f61e6d9d..c1661bd1a 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,5 @@ obj/ # clangd .cache + +sentry-native.sln diff --git a/CHANGELOG.md b/CHANGELOG.md index 538aad2a2..b0daaa34e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,12 +3,13 @@ ## Unreleased **Breaking changes**: + - Change transaction sampling to be trace-based. Now, for a given `traces_sample_rate`, either all transactions in a trace get sampled or none do with probability equal to that sample rate. ([#1254](https://github.com/getsentry/sentry-native/pull/1254)) +- Moved Xbox toolchains to an Xbox-specific repository [sentry-xbox](https://github.com/getsentry/sentry-xbox). You can request access to the repository by following the instructions in [Xbox documentation](https://docs.sentry.io/platforms/xbox/) ([#1329](https://github.com/getsentry/sentry-native/pull/1329)) **Features**: - Add `sentry_clear_attachments()` to allow clearing all previously added attachments in the global scope. ([#1290](https://github.com/getsentry/sentry-native/pull/1290)) -- Compiles also on Xbox One ([#1294](https://github.com/getsentry/sentry-native/pull/1294)) - Provide `sentry_regenerate_trace()` to allow users to set manual trace boundaries. ([#1293](https://github.com/getsentry/sentry-native/pull/1293)) - Add `Dynamic Sampling Context (DSC)` to events. ([#1254](https://github.com/getsentry/sentry-native/pull/1254)) - Add `sentry_value_new_feedback` and `sentry_capture_feedback` to allow capturing [User Feedback](https://develop.sentry.dev/sdk/data-model/envelope-items/#user-feedback). ([#1304](https://github.com/getsentry/sentry-native/pull/1304)) @@ -16,11 +17,6 @@ - Add `sentry_envelope_read_from_file`, `sentry_envelope_get_header`, and `sentry_capture_envelope`. ([#1320](https://github.com/getsentry/sentry-native/pull/1320)) - Add `(u)int64` `sentry_value_t` type. ([#1326](https://github.com/getsentry/sentry-native/pull/1326)) -**Fixes**: - -- Update Xbox toolchain to include `UseDebugLibraries` fix for Debug builds. ([#1302](https://github.com/getsentry/sentry-native/pull/1302)) -- Fix GDK version selection for Xbox by propagating `XdkEditionTarget` to MSBuild. ([#1312](https://github.com/getsentry/sentry-native/pull/1312)) - **Meta**: - Marked deprecated functions with `SENTRY_DEPRECATED(msg)`. ([#1308](https://github.com/getsentry/sentry-native/pull/1308)) diff --git a/CMakeLists.txt b/CMakeLists.txt index 98f30edff..773f4fd6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,15 +8,6 @@ else() cmake_minimum_required(VERSION 3.10) cmake_policy(SET CMP0077 NEW) endif() -set(SENTRY_TOOLCHAINS_DIR "${CMAKE_CURRENT_LIST_DIR}/toolchains") -if ("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "Gaming.Xbox.Scarlett.x64") - include("${SENTRY_TOOLCHAINS_DIR}/xbox/CMakeGDKScarlett.cmake") - set(XBOX TRUE) -endif() -if ("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "Gaming.Xbox.XboxOne.x64") - include("${SENTRY_TOOLCHAINS_DIR}/xbox/CMakeGDKXboxOne.cmake") - set(XBOX TRUE) -endif() #read sentry-native version file(READ "include/sentry.h" _SENTRY_HEADER_CONTENT) @@ -60,6 +51,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "AIX" OR CMAKE_SYSTEM_NAME STREQUAL "OS400") set(AIX TRUE) elseif(CMAKE_SYSTEM_NAME STREQUAL "Prospero") set(PROSPERO TRUE) +elseif("${CMAKE_GENERATOR_PLATFORM}" MATCHES "Gaming\\.Xbox\\.(Scarlett|XboxOne)\\.x64") + set(XBOX TRUE) endif() #setup sentry library type diff --git a/README.md b/README.md index f0a2c9028..629a6c23e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Conan Center](https://shields.io/conan/v/sentry-native)](https://conan.io/center/recipes/sentry-native) [![homebrew](https://img.shields.io/homebrew/v/sentry-native)](https://formulae.brew.sh/formula/sentry-native) [![nixpkgs unstable](https://repology.org/badge/version-for-repo/nix_unstable/sentry-native.svg)](https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/by-name/se/sentry-native/package.nix) [![vcpkg](https://shields.io/vcpkg/v/sentry-native)](https://vcpkg.link/ports/sentry-native) +[![Conan Center](https://shields.io/conan/v/sentry-native)](https://conan.io/center/recipes/sentry-native) [![homebrew](https://img.shields.io/homebrew/v/sentry-native)](https://formulae.brew.sh/formula/sentry-native) [![nixpkgs unstable](https://repology.org/badge/version-for-repo/nix_unstable/sentry-native.svg)](https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/by-name/se/sentry-native/package.nix) [![vcpkg](https://shields.io/vcpkg/v/sentry-native)](https://vcpkg.link/ports/sentry-native)

@@ -72,6 +72,9 @@ The SDK currently supports and is tested on the following OS/Compiler variations - macOS 13, 14, 15 with respective most recent Apple compiler toolchain and LLVM clang 15 + 18 - Android API35 built by NDK27 toolchain - Android API16 built by NDK19 toolchain +- PlayStation via [sentry-playstation](https://github.com/getsentry/sentry-playstation). See [PlayStation documentation](https://docs.sentry.io/platforms/playstation/) to get access. +- Xbox via [sentry-xbox](https://github.com/getsentry/sentry-xbox). See [Xbox documentation](https://docs.sentry.io/platforms/xbox/) to get access. +- Nintendo Switch via [sentry-switch](https://github.com/getsentry/sentry-switch). See [Nintendo Switch documentation](https://docs.sentry.io/platforms/nintendo-switch/) to get access. Additionally, the SDK should support the following platforms, although they are not automatically tested, so breakage may occur: diff --git a/toolchains/xbox/CMakeGDKScarlett.cmake b/toolchains/xbox/CMakeGDKScarlett.cmake deleted file mode 100644 index 91aef2dc8..000000000 --- a/toolchains/xbox/CMakeGDKScarlett.cmake +++ /dev/null @@ -1,224 +0,0 @@ -# Adapted by Sentry from: -# https://github.com/microsoft/Xbox-GDK-Samples/blob/e5328b9c06443739ec9c7c0089a36c5743c9da15/Samples/Tools/CMakeExample/CMake/CMakeGDKScarlett.cmake -# -# CMakeGDKScarlett.cmake : CMake definitions for Microsoft GDK targeting Xbox Series X|S -# -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. - -mark_as_advanced(CMAKE_TOOLCHAIN_FILE) - -if(_GDK_SCARLETT_TOOLCHAIN_) - return() -endif() - -set(XBOX_CONSOLE_TARGET "scarlett" CACHE STRING "") - -#--- Microsoft Game Development Kit - -include("${CMAKE_CURRENT_LIST_DIR}/DetectGDK.cmake") - -set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES GDK_VERSION BUILD_USING_BWOI) - -#--- Windows SDK -include("${CMAKE_CURRENT_LIST_DIR}/DetectWindowsSDK.cmake") - -set(CMAKE_SYSTEM_NAME WINDOWS) -set(CMAKE_SYSTEM_VERSION ${WINDOWS_SDK_VER}) -set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION ${WINDOWS_SDK_VER}) - -#--- Locate Visual Studio (needed for VC Runtime DLLs) - -if (NOT DEFINED VCInstallDir AND DEFINED ENV{VCINSTALLDIR}) - cmake_path(SET VCInstallDir "$ENV{VCINSTALLDIR}") -endif() - -if (NOT DEFINED VCInstallDir) - set(GDK_VS_EDITIONS "Community" "Professional" "Enterprise" "Preview" "BuildTools") - - if (MSVC_TOOLSET_VERSION MATCHES "143") - foreach(vsedition IN LISTS GDK_VS_EDITIONS) - cmake_path(SET VCInstallDir "$ENV{ProgramFiles}/Microsoft Visual Studio/2022/${vsedition}/VC") - if(EXISTS ${VCInstallDir}) - break() - endif() - endforeach() - else() - foreach(vsedition IN LISTS GDK_VS_EDITIONS) - cmake_path(SET VCInstallDir "$ENV{ProgramFiles\(x86\)}/Microsoft Visual Studio/2019/${vsedition}/VC") - if(EXISTS ${VCInstallDir}) - break() - endif() - endforeach() - - if (NOT EXISTS ${VCInstallDir}) - foreach(vsedition IN LISTS GDK_VS_EDITIONS) - cmake_path(SET VCInstallDir "$ENV{ProgramFiles}/Microsoft Visual Studio/2022/${vsedition}/VC") - if(EXISTS ${VCInstallDir}) - break() - endif() - endforeach() - endif() - endif() -endif() - -if(EXISTS ${VCInstallDir}) - message("VCInstallDir = ${VCInstallDir}") -else() - message(FATAL_ERROR "ERROR: Failed to locate Visual Studio 2019 or 2022 install") -endif() - -# Find VC toolset/runtime versions -file(STRINGS "${VCInstallDir}/Auxiliary/Build/Microsoft.VCToolsVersion.default.txt" VCToolsVersion) -message("VCToolsVersion = ${VCToolsVersion}") - -file(STRINGS "${VCInstallDir}/Auxiliary/Build/Microsoft.VCRedistVersion.default.txt" VCToolsRedistVersion) -message("VCToolsRedistVersion = ${VCToolsRedistVersion}") - -#--- GameRuntime and Extension Libraries -set(_GDK_XBOX_ ON) -include("${SENTRY_TOOLCHAINS_DIR}/xbox/GDK-targets.cmake") - -set(DurangoXdkInstallPath "${Console_SdkRoot}/${GDK_VERSION}") - -message("Microsoft GDK = ${DurangoXdkInstallPath}") - -#--- Windows SDK -if(EXISTS "${WINDOWS_SDK}/Include/${WINDOWS_SDK_VER}" ) - message("Windows SDK = v${WINDOWS_SDK_VER} in ${WINDOWS_SDK}") -else() - message(FATAL_ERROR "ERROR: Cannot locate Windows SDK (${WINDOWS_SDK_VER})") -endif() - -#--- Headers -set(Console_EndpointIncludeRoot - "${DurangoXdkInstallPath}/GXDK/gameKit/Include" - "${DurangoXdkInstallPath}/GXDK/gameKit/Include/Scarlett" - "${DurangoXdkInstallPath}/GRDK/gameKit/Include") -set(Console_WindowsIncludeRoot ${WINDOWS_SDK}/Include/${WINDOWS_SDK_VER}) -set(Console_SdkIncludeRoot - "${Console_EndpointIncludeRoot}" - "${Console_WindowsIncludeRoot}/um" - "${Console_WindowsIncludeRoot}/shared" - "${Console_WindowsIncludeRoot}/winrt" - "${Console_WindowsIncludeRoot}/cppwinrt" - "${Console_WindowsIncludeRoot}/ucrt") - -#--- Libraries -# Don't link with onecore.lib, kernel32.lib, etc. -set(CMAKE_CXX_STANDARD_LIBRARIES "") -set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "") - -# Need to link with "onecore" versions of Visual C++ libraries ("msvc_x64_x64" environment uses desktop libpath) -set(VC_OneCore_LibPath "${VCInstallDir}/Tools/MSVC/${VCToolsVersion}/lib/onecore/x64") -if(NOT EXISTS ${VC_OneCore_LibPath}/msvcrt.lib) - message(FATAL_ERROR "ERROR: Cannot locate msvcrt.lib for the Visual C++ toolset (${VCToolsVersion})") -endif() - -set(Console_LibRoot ${WINDOWS_SDK}/Lib/${WINDOWS_SDK_VER}) -set(Console_EndpointLibRoot - "${DurangoXdkInstallPath}/GXDK/gameKit/Lib/amd64" - "${DurangoXdkInstallPath}/GXDK/gameKit/Lib/amd64/Scarlett" - "${DurangoXdkInstallPath}/GRDK/gameKit/Lib/amd64") -set(Console_SdkLibPath - "${Console_EndpointLibRoot}" - "${Console_LibRoot}/ucrt/x64" - "${Console_LibRoot}/um/x64") - -set(Console_Libs pixevt.lib d3d12_xs.lib xgameplatform.lib xgameruntime.lib xmem.lib xg_xs.lib) - -#--- Binaries -set(GameOSFilePath ${DurangoXdkInstallPath}/GXDK/sideload/gameos.xvd) - -set(Console_UCRTRedistDebug ${WINDOWS_SDK}/bin/${WINDOWS_SDK_VER}/x64/ucrt) -if(NOT EXISTS ${Console_UCRTRedistDebug}/ucrtbased.dll) - message(FATAL_ERROR "ERROR: Cannot locate ucrtbased.dll in the Windows SDK (${WINDOWS_SDK_VER})") -endif() - -set(CRTPlatformToolset 143) -if (NOT EXISTS "${VCInstallDir}/redist/MSVC/${VCToolsRedistVersion}/onecore/x64/Microsoft.VC${CRTPlatformToolset}.CRT") - set(CRTPlatformToolset 142) -endif() - -message("CRT Platform Toolset = ${CRTPlatformToolset}") - -set(CppRuntimeFilesPath "${VCInstallDir}/redist/MSVC/${VCToolsRedistVersion}/onecore/x64/Microsoft.VC${CRTPlatformToolset}.CRT") -set(OpenMPRuntimeFilesPath "${VCInstallDir}/redist/MSVC/${VCToolsRedistVersion}/onecore/x64/Microsoft.VC${CRTPlatformToolset}.OpenMP") -if(CMAKE_BUILD_TYPE MATCHES "Debug") - set(DebugCppRuntimeFilesPath "${VCInstallDir}/redist/MSVC/${VCToolsRedistVersion}/onecore/Debug_NonRedist/x64/Microsoft.VC${CRTPlatformToolset}.DebugCRT") - set(DebugOpenMPRuntimeFilesPath "${VCInstallDir}/redist/MSVC/${VCToolsRedistVersion}/onecore/Debug_NonRedist/x64/Microsoft.VC${CRTPlatformToolset}.DebugOpenMP") -endif() - -#--- 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 - REQUIRED NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH NO_DEFAULT_PATH - HINTS "${DurangoXdkInstallPath}/GXDK/bin/Scarlett") - -message("DXC Compiler = ${DIRECTX_DXC_TOOL}") - -#--- Build options -# Required preprocessor defines -# WIN32 -# _WINDOWS - -# Standard Debug vs. Release preprocessor definitions -# (automatically defined by MSVC and MSVC-like compilers) -# _DEBUG (Debug) -# NDEBUG (Release without asserts) - -# Build as Unicode (see UTF-8 Everywhere article's Win32 recommendations) -set(Console_Defines _UNICODE UNICODE) - -# Game Core on Xbox preprocessor definitions -set(Console_Defines ${Console_Defines} WIN32_LEAN_AND_MEAN _GAMING_XBOX WINAPI_FAMILY=WINAPI_FAMILY_GAMES) - -# Preprocessor definition for Xbox Series X|S -set(Console_Defines ${Console_Defines} _GAMING_XBOX_SCARLETT) - -# Additional recommended preprocessor defines -set(Console_Defines ${Console_Defines} _CRT_USE_WINAPI_PARTITION_APP _UITHREADCTXT_SUPPORT=0 __WRL_CLASSIC_COM_STRICT__) - -# Default library controls -set(Console_Defines ${Console_Defines} _ATL_NO_DEFAULT_LIBS __WRL_NO_DEFAULT_LIB__) - -set(UnsupportedLibs advapi32.lib comctl32.lib comsupp.lib dbghelp.lib gdi32.lib gdiplus.lib guardcfw.lib kernel32.lib mmc.lib msimg32.lib msvcole.lib msvcoled.lib mswsock.lib ntstrsafe.lib ole2.lib ole2autd.lib ole2auto.lib ole2d.lib ole2ui.lib ole2uid.lib ole32.lib oleacc.lib oleaut32.lib oledlg.lib oledlgd.lib oldnames.lib runtimeobject.lib shell32.lib shlwapi.lib strsafe.lib urlmon.lib user32.lib userenv.lib wlmole.lib wlmoled.lib onecore.lib) - -# Required compiler switches: -# /MD or /MDd (VC Runtime DLL) -# /O? or /Od (Optimize code) - -# Required linker switches: -# /MACHINE:X64 /SUBSYSTEM:WINDOWS -# /DYNAMICBASE -# /NXCOMPAT -set(Console_LinkOptions /DYNAMICBASE /NXCOMPAT) - -# Prevent accidental use of libraries that are not supported by Game Core on Xbox -foreach(arg ${UnsupportedLibs}) - list(APPEND Console_LinkOptions "/NODEFAULTLIB:${arg}") -endforeach() - -if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - # /favor:AMD64 - # /arch:AVX2 - set(Console_ArchOptions /favor:AMD64 /arch:AVX2) - - # Scarlett titles should use this switch to optimize the vzeroupper codegen (requires VS 2019 16.3 or later) - if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.23) - set(Console_ArchOptions ${Console_ArchOptions} /d2vzeroupper) - set(Console_ArchOptions_LTCG /d2:-vzeroupper) - endif() - -endif() -if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - # -march=znver2 to target AMD Hercules CPU (requires clang v9; otherwise use znver1) - set(Console_ArchOptions -march=$,9.0>,znver2,znver1>) -endif() - -set(_GDK_SCARLETT_TOOLCHAIN_ ON) diff --git a/toolchains/xbox/CMakeGDKXboxOne.cmake b/toolchains/xbox/CMakeGDKXboxOne.cmake deleted file mode 100644 index b27bd091c..000000000 --- a/toolchains/xbox/CMakeGDKXboxOne.cmake +++ /dev/null @@ -1,224 +0,0 @@ -# Adapted by Sentry from: -# https://raw.githubusercontent.com/microsoft/Xbox-GDK-Samples/710f4bd9095d3796d07505249a7b383857e8a23f/Samples/Tools/CMakeExample/CMake/CMakeGDKXboxOne.cmake -# -# CMakeGDKXboxOne.cmake : CMake definitions for Microsoft GDK targeting Xbox One/Xbox One S/Xbox One X -# -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. - -mark_as_advanced(CMAKE_TOOLCHAIN_FILE) - -if(_GDK_XBOX_ONE_TOOLCHAIN_) - return() -endif() - -set(XBOX_CONSOLE_TARGET "xboxone" CACHE STRING "") - -include("${CMAKE_CURRENT_LIST_DIR}/DetectGDK.cmake") - -message("XdkEditionTarget = ${XdkEditionTarget}") - -set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES GDK_VERSION BUILD_USING_BWOI) - -#--- Windows SDK -include("${CMAKE_CURRENT_LIST_DIR}/DetectWindowsSDK.cmake") - -set(CMAKE_SYSTEM_NAME WINDOWS) -set(CMAKE_SYSTEM_VERSION ${WINDOWS_SDK_VER}) -set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION ${WINDOWS_SDK_VER}) - -#--- Locate Visual Studio (needed for VC Runtime DLLs) - -if (NOT DEFINED VCInstallDir AND DEFINED ENV{VCINSTALLDIR}) - cmake_path(SET VCInstallDir "$ENV{VCINSTALLDIR}") -endif() - -if (NOT DEFINED VCInstallDir) - set(GDK_VS_EDITIONS "Community" "Professional" "Enterprise" "Preview" "BuildTools") - - if (MSVC_TOOLSET_VERSION MATCHES "143") - foreach(vsedition IN LISTS GDK_VS_EDITIONS) - cmake_path(SET VCInstallDir "$ENV{ProgramFiles}/Microsoft Visual Studio/2022/${vsedition}/VC") - if(EXISTS ${VCInstallDir}) - break() - endif() - endforeach() - else() - foreach(vsedition IN LISTS GDK_VS_EDITIONS) - cmake_path(SET VCInstallDir "$ENV{ProgramFiles\(x86\)}/Microsoft Visual Studio/2019/${vsedition}/VC") - if(EXISTS ${VCInstallDir}) - break() - endif() - endforeach() - - if (NOT EXISTS ${VCInstallDir}) - foreach(vsedition IN LISTS GDK_VS_EDITIONS) - cmake_path(SET VCInstallDir "$ENV{ProgramFiles}/Microsoft Visual Studio/2022/${vsedition}/VC") - if(EXISTS ${VCInstallDir}) - break() - endif() - endforeach() - endif() - endif() -endif() - -if(EXISTS ${VCInstallDir}) - message("VCInstallDir = ${VCInstallDir}") -else() - message(FATAL_ERROR "ERROR: Failed to locate Visual Studio 2019 or 2022 install") -endif() - -# Find VC toolset/runtime versions -file(STRINGS "${VCInstallDir}/Auxiliary/Build/Microsoft.VCToolsVersion.default.txt" VCToolsVersion) -message("VCToolsVersion = ${VCToolsVersion}") - -file(STRINGS "${VCInstallDir}/Auxiliary/Build/Microsoft.VCRedistVersion.default.txt" VCToolsRedistVersion) -message("VCToolsRedistVersion = ${VCToolsRedistVersion}") - -#--- GameRuntime and Extension Libraries -set(_GDK_XBOX_ ON) -include("${SENTRY_TOOLCHAINS_DIR}/xbox/GDK-targets.cmake") - -set(DurangoXdkInstallPath "${Console_SdkRoot}/${GDK_VERSION}") - -message("Microsoft GDK = ${DurangoXdkInstallPath}") - -#--- Windows SDK -if(EXISTS "${WINDOWS_SDK}/Include/${WINDOWS_SDK_VER}" ) - message("Windows SDK = v${WINDOWS_SDK_VER} in ${WINDOWS_SDK}") -else() - message(FATAL_ERROR "ERROR: Cannot locate Windows SDK (${WINDOWS_SDK_VER})") -endif() - -#--- Headers -set(Console_EndpointIncludeRoot - "${DurangoXdkInstallPath}/GXDK/gameKit/Include" - "${DurangoXdkInstallPath}/GXDK/gameKit/Include/XboxOne" - "${DurangoXdkInstallPath}/GRDK/gameKit/Include") -set(Console_WindowsIncludeRoot ${WindowsSdkDir}/Include/${SDKVersion}) -set(Console_SdkIncludeRoot - "${Console_EndpointIncludeRoot}" - "${Console_WindowsIncludeRoot}/um" - "${Console_WindowsIncludeRoot}/shared" - "${Console_WindowsIncludeRoot}/winrt" - "${Console_WindowsIncludeRoot}/cppwinrt" - "${Console_WindowsIncludeRoot}/ucrt") - -#--- Libraries -# Don't link with onecore.lib, kernel32.lib, etc. -set(CMAKE_CXX_STANDARD_LIBRARIES "") -set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "") - -# Need to link with "onecore" versions of Visual C++ libraries ("msvc_x64_x64" environment uses desktop libpath) -set(VC_OneCore_LibPath "${VCInstallDir}/Tools/MSVC/${VCToolsVersion}/lib/onecore/x64") -if(NOT EXISTS ${VC_OneCore_LibPath}/msvcrt.lib) - message(FATAL_ERROR "ERROR: Cannot locate msvcrt.lib for the Visual C++ toolset (${VCToolsVersion})") -endif() - -set(Console_LibRoot ${WINDOWS_SDK}/Lib/${WINDOWS_SDK_VER}) -set(Console_EndpointLibRoot - "${DurangoXdkInstallPath}/GXDK/gameKit/Lib/amd64" - "${DurangoXdkInstallPath}/GXDK/gameKit/Lib/amd64/XboxOne" - "${DurangoXdkInstallPath}/GRDK/gameKit/Lib/amd64") -set(Console_SdkLibPath - "${Console_EndpointLibRoot}" - "${Console_LibRoot}/ucrt/x64" - "${Console_LibRoot}/um/x64") - -set(Console_Libs pixevt.lib d3d12_x.lib xgameplatform.lib xgameruntime.lib xmem.lib xg_x.lib) - -#--- Binaries -set(GameOSFilePath ${DurangoXdkInstallPath}/GXDK/sideload/gameos.xvd) - -set(Console_UCRTRedistDebug ${WINDOWS_SDK}/bin/${WINDOWS_SDK_VER}/x64/ucrt) -if(NOT EXISTS ${Console_UCRTRedistDebug}/ucrtbased.dll) - message(FATAL_ERROR "ERROR: Cannot locate ucrtbased.dll in the Windows SDK (${SDKVersion})") -endif() - -set(CRTPlatformToolset 143) -if (NOT EXISTS "${VCInstallDir}/redist/MSVC/${VCToolsRedistVersion}/onecore/x64/Microsoft.VC${CRTPlatformToolset}.CRT") - set(CRTPlatformToolset 142) -endif() - -message("CRT Platform Toolset = ${CRTPlatformToolset}") - -set(CppRuntimeFilesPath "${VCInstallDir}/redist/MSVC/${VCToolsRedistVersion}/onecore/x64/Microsoft.VC${CRTPlatformToolset}.CRT") -set(OpenMPRuntimeFilesPath "${VCInstallDir}/redist/MSVC/${VCToolsRedistVersion}/onecore/x64/Microsoft.VC${CRTPlatformToolset}.OpenMP") -if(CMAKE_BUILD_TYPE MATCHES "Debug") - set(DebugCppRuntimeFilesPath "${VCInstallDir}/redist/MSVC/${VCToolsRedistVersion}/onecore/Debug_NonRedist/x64/Microsoft.VC${CRTPlatformToolset}.DebugCRT") - set(DebugOpenMPRuntimeFilesPath "${VCInstallDir}/redist/MSVC/${VCToolsRedistVersion}/onecore/Debug_NonRedist/x64/Microsoft.VC${CRTPlatformToolset}.DebugOpenMP") -endif() - -#--- 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 - REQUIRED NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH NO_DEFAULT_PATH - HINTS "${DurangoXdkInstallPath}/GXDK/bin/XboxOne") - -message("DXC Compiler = ${DIRECTX_DXC_TOOL}") - -#--- Build options -# Required preprocessor defines -# WIN32 -# _WINDOWS - -# Standard Debug vs. Release preprocessor definitions -# (automatically defined by MSVC and MSVC-like compilers) -# _DEBUG (Debug) -# NDEBUG (Release without asserts) - -# Build as Unicode (see UTF-8 Everywhere article's Win32 recommendations) -set(Console_Defines _UNICODE UNICODE) - -# Game Core on Xbox preprocessor definitions -set(Console_Defines ${Console_Defines} WIN32_LEAN_AND_MEAN _GAMING_XBOX WINAPI_FAMILY=WINAPI_FAMILY_GAMES) - -# Preprocessor definition for Xbox One/Xbox One S/Xbox One X -set(Console_Defines ${Console_Defines} _GAMING_XBOX_XBOXONE) - -# Additional recommended preprocessor defines -set(Console_Defines ${Console_Defines} _CRT_USE_WINAPI_PARTITION_APP _UITHREADCTXT_SUPPORT=0 __WRL_CLASSIC_COM_STRICT__) - -# Default library controls -set(Console_Defines ${Console_Defines} _ATL_NO_DEFAULT_LIBS __WRL_NO_DEFAULT_LIB__) - -set(UnsupportedLibs advapi32.lib comctl32.lib comsupp.lib dbghelp.lib gdi32.lib gdiplus.lib guardcfw.lib kernel32.lib mmc.lib msimg32.lib msvcole.lib msvcoled.lib mswsock.lib ntstrsafe.lib ole2.lib ole2autd.lib ole2auto.lib ole2d.lib ole2ui.lib ole2uid.lib ole32.lib oleacc.lib oleaut32.lib oledlg.lib oledlgd.lib oldnames.lib runtimeobject.lib shell32.lib shlwapi.lib strsafe.lib urlmon.lib user32.lib userenv.lib wlmole.lib wlmoled.lib onecore.lib) - -# Required compiler switches: -# /MD or /MDd (VC Runtime DLL) -# /O? or /Od (Optimize code) - -# Required linker switches: -# /MACHINE:X64 /SUBSYSTEM:WINDOWS -# /DYNAMICBASE -# /NXCOMPAT -set(Console_LinkOptions /DYNAMICBASE /NXCOMPAT) - -# Prevent accidental use of libraries that are not supported by Game Core on Xbox -foreach(arg ${UnsupportedLibs}) - list(APPEND Console_LinkOptions "/NODEFAULTLIB:${arg}") -endforeach() - -if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") - # /favor:AMD64 - # /arch:AVX - set(Console_ArchOptions /favor:AMD64 /arch:AVX) - - # Xbox One titles should use this switch to optimize the vzeroupper codegen with VS 2022 - if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.30) - set(Console_ArchOptions ${Console_ArchOptions} /d2vzeroupper-) - set(Console_ArchOptions_LTCG /d2:-vzeroupper-) - endif() - -endif() -if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - # -march=btver2 to target AMD Jaguar CPU - set(Console_ArchOptions -march=btver2) -endif() - -set(_GDK_XBOX_ONE_TOOLCHAIN_ ON) diff --git a/toolchains/xbox/DetectGDK.cmake b/toolchains/xbox/DetectGDK.cmake deleted file mode 100644 index 74913f9a4..000000000 --- a/toolchains/xbox/DetectGDK.cmake +++ /dev/null @@ -1,10 +0,0 @@ -get_filename_component(GDK_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\GDK;InstallPath]" ABSOLUTE CACHE) - -if(NOT GDK_VERSION) - FILE(GLOB subfolders RELATIVE "${GDK_DIR}" "${GDK_DIR}/*") - list(FILTER subfolders INCLUDE REGEX "[0-9]+") - list(SORT subfolders COMPARE NATURAL) # sort by version number - list(GET subfolders -1 GDK_VERSION) # GET -1 is last element, i.e. highest version -endif() - -message(STATUS "Using GDK version ${GDK_VERSION} at ${GDK_DIR}") \ No newline at end of file diff --git a/toolchains/xbox/DetectWindowsSDK.cmake b/toolchains/xbox/DetectWindowsSDK.cmake deleted file mode 100644 index 312e6ab52..000000000 --- a/toolchains/xbox/DetectWindowsSDK.cmake +++ /dev/null @@ -1,9 +0,0 @@ -get_filename_component(WINDOWS_SDK "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" ABSOLUTE CACHE) - -if(NOT WINDOWS_SDK_VER) - file(GLOB subfolders RELATIVE "${WINDOWS_SDK}/Lib" "${WINDOWS_SDK}/Lib/*") - list(SORT subfolders COMPARE NATURAL) # sort by version number - list(GET subfolders -1 WINDOWS_SDK_VER) # GET -1 is last element, i.e. highest version -endif () - -message(STATUS "Using Windows SDK version ${WINDOWS_SDK_VER} at ${WINDOWS_SDK}") \ No newline at end of file diff --git a/toolchains/xbox/GDK-targets.cmake b/toolchains/xbox/GDK-targets.cmake deleted file mode 100644 index 6a23ddfaf..000000000 --- a/toolchains/xbox/GDK-targets.cmake +++ /dev/null @@ -1,68 +0,0 @@ -# Adapted by Sentry from: -# https://github.com/microsoft/Xbox-GDK-Samples/blob/710f4bd9095d3796d07505249a7b383857e8a23f/Samples/Tools/CMakeExample/CMake/GDK-targets.cmake -# -# GDK-targets.cmake : Defines library imports for the Microsoft GDK shared libraries -# -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. - -if(_GDK_TARGETS_) - return() -endif() - -if(CMAKE_SIZEOF_VOID_P EQUAL 4) - message(FATAL_ERROR "ERROR: Microsoft GDK only supports 64-bit") -endif() - -if(NOT GDK_VERSION) - message(FATAL_ERROR "ERROR: GDK_VERSION must be set") -endif() - -#--- Locate Microsoft GDK -if(BUILD_USING_BWOI) - if(DEFINED ENV{ExtractedFolder}) - cmake_path(SET ExtractedFolder "$ENV{ExtractedFolder}") - else() - set(ExtractedFolder "d:/xtrctd.sdks/BWOIExample/") - endif() - - if(NOT EXISTS ${ExtractedFolder}) - message(FATAL_ERROR "ERROR: BWOI requires a valid ExtractedFolder (${ExtractedFolder})") - endif() - - set(Console_SdkRoot "${ExtractedFolder}/Microsoft GDK") -else() - GET_FILENAME_COMPONENT(Console_SdkRoot "[HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\GDK;GRDKInstallPath]" ABSOLUTE CACHE) -endif() - -if(NOT EXISTS "${Console_SdkRoot}/${GDK_VERSION}") - message(FATAL_ERROR "ERROR: Cannot locate Microsoft Game Development Kit (GDK) - ${GDK_VERSION}") -endif() - -#--- GameRuntime Library (for Xbox these are included in the Console_Libs variable) -if(NOT _GDK_XBOX_) - add_library(Xbox::GameRuntime STATIC IMPORTED) - set_target_properties(Xbox::GameRuntime PROPERTIES - IMPORTED_LOCATION "${Console_SdkRoot}/${GDK_VERSION}/GRDK/gameKit/Lib/amd64/xgameruntime.lib" - MAP_IMPORTED_CONFIG_MINSIZEREL "" - MAP_IMPORTED_CONFIG_RELWITHDEBINFO "" - INTERFACE_INCLUDE_DIRECTORIES "${Console_SdkRoot}/${GDK_VERSION}/GRDK/gameKit/Include" - INTERFACE_COMPILE_FEATURES "cxx_std_11" - IMPORTED_LINK_INTERFACE_LANGUAGES "CXX") - - if(GDK_VERSION GREATER_EQUAL 220600) - add_library(Xbox::GameInput STATIC IMPORTED) - set_target_properties(Xbox::GameInput PROPERTIES - IMPORTED_LOCATION "${Console_SdkRoot}/${GDK_VERSION}/GRDK/gameKit/Lib/amd64/gameinput.lib" - MAP_IMPORTED_CONFIG_MINSIZEREL "" - MAP_IMPORTED_CONFIG_RELWITHDEBINFO "" - INTERFACE_INCLUDE_DIRECTORIES "${Console_SdkRoot}/${GDK_VERSION}/GRDK/gameKit/Include" - IMPORTED_LINK_INTERFACE_LANGUAGES "CXX") - endif() -endif() - -#--- Extension Libraries -set(Console_GRDKExtLibRoot "${Console_SdkRoot}/${GDK_VERSION}/GRDK/ExtensionLibraries") -set(ExtensionPlatformToolset 142) - -set(_GDK_TARGETS_ ON) diff --git a/toolchains/xbox/gdk_build.props b/toolchains/xbox/gdk_build.props deleted file mode 100644 index 6b063850d..000000000 --- a/toolchains/xbox/gdk_build.props +++ /dev/null @@ -1,45 +0,0 @@ - - - - - $(Console_SdkLibPath);$(LibraryPath) - $(Console_SdkIncludeRoot);$(IncludePath) - - - - $(Console_SdkLibPath);$(LibraryPath) - $(Console_SdkIncludeRoot);$(IncludePath) - - - - $(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath) - $(Console_SdkLibPath) - $(Console_SdkIncludeRoot) - $(Console_SdkRoot)bin;$(Console_SdkToolPath);$(ExecutablePath) - - - - $(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath) - $(Console_SdkLibPath) - $(Console_SdkIncludeRoot) - $(Console_SdkRoot)bin;$(Console_SdkToolPath);$(ExecutablePath) - - - - $(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath) - $(Console_SdkLibPath) - $(Console_SdkIncludeRoot) - $(Console_SdkRoot)bin;$(Console_SdkToolPath);$(ExecutablePath) - - - - $(Console_SdkLibPath);$(Console_SdkWindowsMetadataPath) - $(Console_SdkLibPath) - $(Console_SdkIncludeRoot) - $(Console_SdkRoot)bin;$(Console_SdkToolPath);$(ExecutablePath) - - - diff --git a/toolchains/xbox/gxdk_toolchain.cmake b/toolchains/xbox/gxdk_toolchain.cmake deleted file mode 100644 index 885dadd7e..000000000 --- a/toolchains/xbox/gxdk_toolchain.cmake +++ /dev/null @@ -1,68 +0,0 @@ -# Adapted by Sentry from: -# https://github.com/microsoft/Xbox-GDK-Samples/blob/710f4bd9095d3796d07505249a7b383857e8a23f/Samples/Tools/CMakeGDKExample/gxdk_toolchain.cmake -# -# grdk_toolchain.cmake : CMake Toolchain file for Gaming.Xbox.XboxOne.x64 -# -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. - -mark_as_advanced(CMAKE_TOOLCHAIN_FILE) - -if(_GXDK_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 ${GDK_VERSION}) - -set(CMAKE_GENERATOR_PLATFORM "Gaming.Xbox.XboxOne.x64" CACHE STRING "" FORCE) -set(CMAKE_VS_PLATFORM_NAME "Gaming.Xbox.XboxOne.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) - -# Propagate GDK version to MSBuild -set(CMAKE_VS_GLOBALS "XdkEditionTarget=${GDK_VERSION}" CACHE STRING "" FORCE) - -if(${CMAKE_VERSION} GREATER_EQUAL "3.30") - set(CMAKE_VS_USE_DEBUG_LIBRARIES "$" CACHE STRING "" FORCE) -endif() - -# Sets platform defines -set(CMAKE_CXX_FLAGS_INIT "$ENV{CFLAGS} ${CMAKE_CXX_FLAGS_INIT} -D_GAMING_XBOX -D_GAMING_XBOX_ONE -DWINAPI_FAMILY=WINAPI_FAMILY_GAMES -D_ATL_NO_DEFAULT_LIBS -D__WRL_NO_DEFAULT_LIB__ -D_CRT_USE_WINAPI_PARTITION_APP -D_UITHREADCTXT_SUPPORT=0 -D__WRL_CLASSIC_COM_STRICT__ /arch:AVX /favor:AMD64" CACHE STRING "" FORCE) - -# Set platform libraries -set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "xgameplatform.lib" CACHE STRING "" FORCE) -set(CMAKE_CXX_STANDARD_LIBRARIES ${CMAKE_CXX_STANDARD_LIBRARIES_INIT} CACHE STRING "" FORCE) - -foreach(t EXE SHARED MODULE) - # Prevent accidental use of libraries that are not supported by Game Core on Xbox - string(APPEND CMAKE_${t}_LINKER_FLAGS_INIT " /NODEFAULTLIB:advapi32.lib /NODEFAULTLIB:comctl32.lib /NODEFAULTLIB:comsupp.lib /NODEFAULTLIB:dbghelp.lib /NODEFAULTLIB:gdi32.lib /NODEFAULTLIB:gdiplus.lib /NODEFAULTLIB:guardcfw.lib /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:mmc.lib /NODEFAULTLIB:msimg32.lib /NODEFAULTLIB:msvcole.lib /NODEFAULTLIB:msvcoled.lib /NODEFAULTLIB:mswsock.lib /NODEFAULTLIB:ntstrsafe.lib /NODEFAULTLIB:ole2.lib /NODEFAULTLIB:ole2autd.lib /NODEFAULTLIB:ole2auto.lib /NODEFAULTLIB:ole2d.lib /NODEFAULTLIB:ole2ui.lib /NODEFAULTLIB:ole2uid.lib /NODEFAULTLIB:ole32.lib /NODEFAULTLIB:oleacc.lib /NODEFAULTLIB:oleaut32.lib /NODEFAULTLIB:oledlg.lib /NODEFAULTLIB:oledlgd.lib /NODEFAULTLIB:oldnames.lib /NODEFAULTLIB:runtimeobject.lib /NODEFAULTLIB:shell32.lib /NODEFAULTLIB:shlwapi.lib /NODEFAULTLIB:strsafe.lib /NODEFAULTLIB:urlmon.lib /NODEFAULTLIB:user32.lib /NODEFAULTLIB:userenv.lib /NODEFAULTLIB:wlmole.lib /NODEFAULTLIB:wlmoled.lib /NODEFAULTLIB:onecore.lib") -endforeach() - -# 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) - GET_FILENAME_COMPONENT(Console_SdkRoot "[HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\GDK;InstallPath]" ABSOLUTE CACHE) - - find_program( - GDK_DXCTool - NAMES dxc - PATHS "${Console_SdkRoot}/${GDK_VERSION}/GXDK/bin/XboxOne" - ) - - mark_as_advanced(GDK_DXCTool) -endif() - -set(_GXDK_TOOLCHAIN_ ON) diff --git a/toolchains/xbox/gxdk_xs_toolchain.cmake b/toolchains/xbox/gxdk_xs_toolchain.cmake deleted file mode 100644 index 7e91f968e..000000000 --- a/toolchains/xbox/gxdk_xs_toolchain.cmake +++ /dev/null @@ -1,68 +0,0 @@ -# Adapted by Sentry from: -# https://github.com/microsoft/Xbox-GDK-Samples/blob/aa45b831e7a71160a69a7d13e9d74844dc6aa210/Samples/Tools/CMakeGDKExample/gxdk_xs_toolchain.cmake -# -# grdk_toolchain.cmake : CMake Toolchain file for Gaming.Xbox.Scarlett.x64 -# -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. - -mark_as_advanced(CMAKE_TOOLCHAIN_FILE) - -if(_GXDK_XS_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 ${GDK_VERSION}) - -set(CMAKE_GENERATOR_PLATFORM "Gaming.Xbox.Scarlett.x64" CACHE STRING "" FORCE) -set(CMAKE_VS_PLATFORM_NAME "Gaming.Xbox.Scarlett.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) - -# Propagate GDK version to MSBuild -set(CMAKE_VS_GLOBALS "XdkEditionTarget=${GDK_VERSION}" CACHE STRING "" FORCE) - -if(${CMAKE_VERSION} GREATER_EQUAL "3.30") - set(CMAKE_VS_USE_DEBUG_LIBRARIES "$" CACHE STRING "" FORCE) -endif() - -# Sets platform defines -set(CMAKE_CXX_FLAGS_INIT "$ENV{CFLAGS} ${CMAKE_CXX_FLAGS_INIT} -D_GAMING_XBOX -D_GAMING_XBOX_SCARLETT -DWINAPI_FAMILY=WINAPI_FAMILY_GAMES -D_ATL_NO_DEFAULT_LIBS -D__WRL_NO_DEFAULT_LIB__ -D_CRT_USE_WINAPI_PARTITION_APP -D_UITHREADCTXT_SUPPORT=0 -D__WRL_CLASSIC_COM_STRICT__ /arch:AVX2 /favor:AMD64" CACHE STRING "" FORCE) - -# Set platform libraries -set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "xgameplatform.lib" CACHE STRING "" FORCE) -set(CMAKE_CXX_STANDARD_LIBRARIES ${CMAKE_CXX_STANDARD_LIBRARIES_INIT} CACHE STRING "" FORCE) - -foreach(t EXE SHARED MODULE) - # Prevent accidental use of libraries that are not supported by Game Core on Xbox - string(APPEND CMAKE_${t}_LINKER_FLAGS_INIT " /NODEFAULTLIB:advapi32.lib /NODEFAULTLIB:comctl32.lib /NODEFAULTLIB:comsupp.lib /NODEFAULTLIB:dbghelp.lib /NODEFAULTLIB:gdi32.lib /NODEFAULTLIB:gdiplus.lib /NODEFAULTLIB:guardcfw.lib /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:mmc.lib /NODEFAULTLIB:msimg32.lib /NODEFAULTLIB:msvcole.lib /NODEFAULTLIB:msvcoled.lib /NODEFAULTLIB:mswsock.lib /NODEFAULTLIB:ntstrsafe.lib /NODEFAULTLIB:ole2.lib /NODEFAULTLIB:ole2autd.lib /NODEFAULTLIB:ole2auto.lib /NODEFAULTLIB:ole2d.lib /NODEFAULTLIB:ole2ui.lib /NODEFAULTLIB:ole2uid.lib /NODEFAULTLIB:ole32.lib /NODEFAULTLIB:oleacc.lib /NODEFAULTLIB:oleaut32.lib /NODEFAULTLIB:oledlg.lib /NODEFAULTLIB:oledlgd.lib /NODEFAULTLIB:oldnames.lib /NODEFAULTLIB:runtimeobject.lib /NODEFAULTLIB:shell32.lib /NODEFAULTLIB:shlwapi.lib /NODEFAULTLIB:strsafe.lib /NODEFAULTLIB:urlmon.lib /NODEFAULTLIB:user32.lib /NODEFAULTLIB:userenv.lib /NODEFAULTLIB:wlmole.lib /NODEFAULTLIB:wlmoled.lib /NODEFAULTLIB:onecore.lib") -endforeach() - -# 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) - GET_FILENAME_COMPONENT(Console_SdkRoot "[HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\GDK;InstallPath]" ABSOLUTE CACHE) - - find_program( - GDK_DXCTool - NAMES dxc - PATHS "${Console_SdkRoot}/${GDK_VERSION}/GXDK/bin/Scarlett" - ) - - mark_as_advanced(GDK_DXCTool) -endif() - -set(_GXDK_XS_TOOLCHAIN_ ON) diff --git a/toolchains/xbox/xbox_build.md b/toolchains/xbox/xbox_build.md index 97a950de8..b32e6fea3 100644 --- a/toolchains/xbox/xbox_build.md +++ b/toolchains/xbox/xbox_build.md @@ -1,44 +1,4 @@ ## Xbox Build -The instructions below work for Xbox Series X|S (Scarlett) as well as Xbox One. -The parts that are different are explicitly called out. - -### Requirements - -* Visual Studio - tested with `2022` -* CMake - tested with `3.27.1 or newer` -* Xbox GDK - tested from `2023.03.03` until latest (as of June 2025) -* Optional: git installed and on your PATH - -### Steps - -* `cd` into the SDK's root folder -* Run `git submodule update --init --recursive` -* Run "Xbox Manager GDK" -* Open Visual Studio Command Prompt for "Xbox Scarlett Gaming". -* Change to the source directory in the prompt -* Optionally you can specify the GDK version - ``` - -DGDK_VERSION="241000" - ``` - * Configure your build using (Xbox Series X|S) - ```pwsh - cmake ` - -B build ` - -G "Visual Studio 17 2022" ` - -A "Gaming.Xbox.Scarlett.x64" ` - -DCMAKE_TOOLCHAIN_FILE="./toolchains/xbox/gxdk_xs_toolchain.cmake" - ``` -* Configure your build using (Xbox One) - ```pwsh - cmake ` - -B build ` - -G "Visual Studio 17 2022" ` - -A "Gaming.Xbox.XboxOne.x64" ` - -DCMAKE_TOOLCHAIN_FILE="./toolchains/xbox/gxdk_toolchain.cmake" - ``` -* After this you can either build the library directly in the CLI with - `cmake --build build --config RelWithDebInfo` (or any other build config) - or in Visual Studio by opening the solution in the `build` directory. -* `cmake --install build --prefix install --config RelWithDebInfo` installs all required development and release files - (`dll`, `pdb`, `lib`, `h`) to include into any Xbox X/S game project into the directory `install`. +This SDK is kept compatible with Xbox but the actual toolchain, CI and integration tests are on a private repository because they rely on GDKX components that can't be made available on this repository and to avoid maintenance complexity everything was moved to the private repository. +We'll send an invite to the repository once you follow the steps documented: See [Xbox documentation](https://docs.sentry.io/platforms/xbox/) to get access."