Skip to content

Commit de97a35

Browse files
authored
Adding support for x64 build with GDK libraries (#902)
1 parent ab02171 commit de97a35

7 files changed

Lines changed: 59 additions & 27 deletions

File tree

Build/libHttpClient.142.GDK.C/libHttpClient.142.GDK.C.vcxproj

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,9 @@
66
<PlatformToolset>v142</PlatformToolset>
77
</PropertyGroup>
88
<Import Project="$([MSBuild]::GetPathOfFileAbove(libHttpClient.GDK.props))" />
9+
910
<Import Project="$(HCBuildRoot)\libHttpClient.Common\libHttpClient.Common.vcxitems" Label="Shared" />
1011
<Import Project="$(HCBuildRoot)\libHttpClient.GDK.Shared\libHttpClient.GDK.Shared.vcxitems" Label="Shared" />
1112
<Import Condition="'$(HCNoZlib)' != 'true'" Project="$(HCBuildRoot)\libHttpClient.Zlib\libHttpClient.Zlib.vcxitems" Label="Shared" />
12-
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">
13-
<ClCompile>
14-
<AdditionalOptions>/Zi /guard:cf %(AdditionalOptions)</AdditionalOptions>
15-
</ClCompile>
16-
</ItemDefinitionGroup>
17-
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">
18-
<ClCompile>
19-
<AdditionalOptions>/Zi /guard:cf %(AdditionalOptions)</AdditionalOptions>
20-
</ClCompile>
21-
</ItemDefinitionGroup>
2213
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
2314
</Project>

Build/libHttpClient.143.GDK.C/libHttpClient.143.GDK.C.vcxproj

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,9 @@
66
<PlatformToolset>v143</PlatformToolset>
77
</PropertyGroup>
88
<Import Project="$([MSBuild]::GetPathOfFileAbove(libHttpClient.GDK.props))" />
9+
910
<Import Project="$(HCBuildRoot)\libHttpClient.Common\libHttpClient.Common.vcxitems" Label="Shared" />
1011
<Import Project="$(HCBuildRoot)\libHttpClient.GDK.Shared\libHttpClient.GDK.Shared.vcxitems" Label="Shared" />
1112
<Import Condition="'$(HCNoZlib)' != 'true'" Project="$(HCBuildRoot)\libHttpClient.Zlib\libHttpClient.Zlib.vcxitems" Label="Shared" />
12-
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Gaming.Desktop.x64'">
13-
<ClCompile>
14-
<AdditionalOptions>/Zi /guard:cf %(AdditionalOptions)</AdditionalOptions>
15-
</ClCompile>
16-
</ItemDefinitionGroup>
17-
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">
18-
<ClCompile>
19-
<AdditionalOptions>/Zi /guard:cf %(AdditionalOptions)</AdditionalOptions>
20-
</ClCompile>
21-
</ItemDefinitionGroup>
2213
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
2314
</Project>

Build/libHttpClient.GDK.Shared/libHttpClient.GDK.Shared.vcxitems.filters

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@
5757
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\Platform\Windows\PlatformTrace_Windows.cpp">
5858
<Filter>Source\Platform\Windows</Filter>
5959
</ClCompile>
60+
<ClCompile Include="$(MSBuildThisFileDirectory)..\..\Source\HTTP\Curl\CurlDynamicLoader.cpp">
61+
<Filter>Source\HTTP\Curl</Filter>
62+
</ClCompile>
6063
</ItemGroup>
6164
<ItemGroup>
6265
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\Common\Win\utils_win.h">
@@ -77,5 +80,8 @@
7780
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\HTTP\WinHttp\winhttp_provider.h">
7881
<Filter>Source\WebSocket\WinHttp</Filter>
7982
</ClInclude>
83+
<ClInclude Include="$(MSBuildThisFileDirectory)..\..\Source\HTTP\Curl\CurlDynamicLoader.h">
84+
<Filter>Source\HTTP\Curl</Filter>
85+
</ClInclude>
8086
</ItemGroup>
8187
</Project>

Build/libHttpClient.GDK.props

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@
1414
<Configuration>Release</Configuration>
1515
<Platform>Gaming.Desktop.x64</Platform>
1616
</ProjectConfiguration>
17+
18+
<!-- Plain x64 configurations enable migration toward standard platform naming while retaining GDK libraries -->
19+
<ProjectConfiguration Include="Debug|x64">
20+
<Configuration>Debug</Configuration>
21+
<Platform>x64</Platform>
22+
</ProjectConfiguration>
23+
<ProjectConfiguration Include="Release|x64">
24+
<Configuration>Release</Configuration>
25+
<Platform>x64</Platform>
26+
</ProjectConfiguration>
1727
</ItemGroup>
1828

1929
<PropertyGroup Label="Globals">
@@ -51,9 +61,32 @@
5161
<!-- Include the main MS props -->
5262
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
5363

64+
<!-- Unify path vars so it can build against public GDK or GDKX -->
5465
<PropertyGroup>
66+
<GDKCrossPlatformPath Condition="'$(GDKCrossPlatformPath)'==''">$(GameDKCoreLatest)</GDKCrossPlatformPath>
67+
<GDKCrossPlatformPath Condition="'$(GDKCrossPlatformPath)'==''">$(GameDKXboxLatest)</GDKCrossPlatformPath>
68+
<GDKCrossPlatformPath Condition="'$(GDKCrossPlatformPath)'==''">$(GameDKLatest)</GDKCrossPlatformPath>
69+
</PropertyGroup>
70+
71+
<!-- GDK path validation -->
72+
<Target Name="GDKEditionCheck" BeforeTargets="PrepareForBuild" Condition="'$(Platform)'=='x64'">
73+
<Error Condition="'$(GDKCrossPlatformPath)'==''" Text="GameDKCoreLatest or GameDKXboxLatest or GameDKLatest environment variable is required" />
74+
<Error Condition="!HasTrailingSlash('$(GDKCrossPlatformPath)')" Text="GDKCrossPlatformPath property must have trailing slash" />
75+
<Error Condition="!Exists('$(GDKCrossPlatformPath)windows')" Text="GDKCrossPlatformPath needs to point to the October 2025 GDK or later" />
76+
<Message Importance="high" Text="Using $(GDKCrossPlatformPath)" />
77+
</Target>
78+
79+
<!-- When using plain x64 platform name, set paths manually -->
80+
<PropertyGroup Condition="'$(Platform)'=='x64'">
81+
<GDKLibPath Condition="'$(GDKLibPath)'==''">$(GDKCrossPlatformPath)windows\lib\x64</GDKLibPath>
82+
<GDKIncludeRoot Condition="'$(GDKIncludeRoot)'==''">$(GDKCrossPlatformPath)windows\include</GDKIncludeRoot>
83+
<LibraryPath>$(GDKLibPath);$(LibraryPath)</LibraryPath>
84+
<IncludePath>$(GDKIncludeRoot);$(IncludePath)</IncludePath>
85+
</PropertyGroup>
86+
87+
<PropertyGroup Condition="'$(Platform)'!='x64'">
5588
<LibraryPath>$(Console_SdkLibPath);$(LibraryPath)</LibraryPath>
56-
<IncludePath>$(Console_SdkIncludeRoot);$(IncludePath)</IncludePath>
89+
<IncludePath>$(Console_SdkIncludeRoot);$(IncludePath)</IncludePath>
5790
</PropertyGroup>
5891

5992
<ItemDefinitionGroup>
@@ -65,8 +98,10 @@
6598
<SupportJustMyCode>false</SupportJustMyCode>
6699
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
67100
<PreprocessorDefinitions>__WRL_NO_DEFAULT_LIB__;_LIB;$(libHttpClientDefine);%(PreprocessorDefinitions)</PreprocessorDefinitions>
68-
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(GameDKLatest)GRDK\ExtensionLibraries\Xbox.XCurl.API\Include</AdditionalIncludeDirectories>
69-
<AdditionalOptions>/bigobj %(AdditionalOptions)</AdditionalOptions>
101+
<AdditionalIncludeDirectories Condition="'$(Platform)'!='x64'">%(AdditionalIncludeDirectories);$(GDKCrossPlatformPath)GRDK\ExtensionLibraries\Xbox.XCurl.API\Include</AdditionalIncludeDirectories>
102+
<ControlFlowGuard>Guard</ControlFlowGuard>
103+
<AdditionalOptions>/Zc:__cplusplus /ZH:SHA_256 /bigobj /Zi %(AdditionalOptions)</AdditionalOptions>
104+
<PreprocessorDefinitions Condition="'$(Platform)'=='x64'">HC_PLATFORM=HC_PLATFORM_GDK;HC_DATAMODEL=HC_DATAMODEL_LLP64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
70105
<LanguageStandard>stdcpp17</LanguageStandard>
71106
</ClCompile>
72107
<Link>
@@ -75,6 +110,7 @@
75110
<GenerateWindowsMetadata>false</GenerateWindowsMetadata>
76111
<FullProgramDatabaseFile Condition="'$(Configuration)'=='Debug'">true</FullProgramDatabaseFile>
77112
<AdditionalDependencies>$(Console_Libs);%(AdditionalDependencies)</AdditionalDependencies>
113+
<AdditionalDependencies Condition="'$(Platform)'=='x64'">xgameruntime.lib;XCurl.lib;%(AdditionalDependencies)</AdditionalDependencies>
78114
</Link>
79115
<Lib>
80116
<AdditionalOptions>/ignore:4099 /ignore:4264 %(AdditionalOptions)</AdditionalOptions>

Build/libHttpClient.GDK/libHttpClient.GDK.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
<ClCompile>
2727
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|Gaming.Desktop.x64'">/Zi /guard:cf %(AdditionalOptions)</AdditionalOptions>
2828
</ClCompile>
29+
<Link>
30+
<CETCompat>true</CETCompat>
31+
</Link>
2932
</ItemDefinitionGroup>
3033
<Import Project="$(HCBuildRoot)\libHttpClient.Common\libHttpClient.Common.vcxitems" Label="Shared" />
3134
<Import Project="$(HCBuildRoot)\libHttpClient.GDK.Shared\libHttpClient.GDK.Shared.vcxitems" Label="Shared" />

Source/Platform/GDK/PlatformComponents_GDK.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ static bool IsRunningOnXboxConsole()
1414
{
1515
#if HC_PLATFORM == HC_PLATFORM_GDK
1616
auto deviceType = XSystemGetDeviceType();
17+
1718
// Explicitly list all Xbox console device types
1819
return deviceType == XSystemDeviceType::XboxOne ||
1920
deviceType == XSystemDeviceType::XboxOneS ||
2021
deviceType == XSystemDeviceType::XboxOneX ||
21-
deviceType == XSystemDeviceType::XboxScarlettLockhart || // Xbox Series S
22-
deviceType == XSystemDeviceType::XboxScarlettAnaconda; // Xbox Series X
22+
deviceType == XSystemDeviceType::XboxOneXDevkit ||
23+
deviceType == XSystemDeviceType::XboxScarlettLockhart || // Xbox Series S
24+
deviceType == XSystemDeviceType::XboxScarlettAnaconda || // Xbox Series X
25+
deviceType == XSystemDeviceType::XboxScarlettDevkit; // Xbox Series Devkit
2326
#else
2427
return false;
2528
#endif

libHttpClient.vs2022.sln

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ Global
114114
{0A6D51A3-0D86-4D0E-9DAA-54BA75E1DA1C}.Debug|ARM64.ActiveCfg = Debug|Gaming.Desktop.x64
115115
{0A6D51A3-0D86-4D0E-9DAA-54BA75E1DA1C}.Debug|Gaming.Desktop.x64.ActiveCfg = Debug|Gaming.Desktop.x64
116116
{0A6D51A3-0D86-4D0E-9DAA-54BA75E1DA1C}.Debug|Gaming.Desktop.x64.Build.0 = Debug|Gaming.Desktop.x64
117-
{0A6D51A3-0D86-4D0E-9DAA-54BA75E1DA1C}.Debug|x64.ActiveCfg = Debug|Gaming.Desktop.x64
117+
{0A6D51A3-0D86-4D0E-9DAA-54BA75E1DA1C}.Debug|x64.ActiveCfg = Debug|x64
118+
{0A6D51A3-0D86-4D0E-9DAA-54BA75E1DA1C}.Debug|x64.Build.0 = Debug|x64
118119
{0A6D51A3-0D86-4D0E-9DAA-54BA75E1DA1C}.Debug|x86.ActiveCfg = Debug|Gaming.Desktop.x64
119120
{0A6D51A3-0D86-4D0E-9DAA-54BA75E1DA1C}.Release|ARM.ActiveCfg = Release|Gaming.Desktop.x64
120121
{0A6D51A3-0D86-4D0E-9DAA-54BA75E1DA1C}.Release|ARM64.ActiveCfg = Release|Gaming.Desktop.x64
@@ -346,7 +347,8 @@ Global
346347
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Debug|ARM64.Build.0 = Debug|Gaming.Desktop.x64
347348
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Debug|Gaming.Desktop.x64.ActiveCfg = Debug|Gaming.Desktop.x64
348349
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Debug|Gaming.Desktop.x64.Build.0 = Debug|Gaming.Desktop.x64
349-
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Debug|x64.ActiveCfg = Debug|Gaming.Desktop.x64
350+
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Debug|x64.ActiveCfg = Debug|x64
351+
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Debug|x64.Build.0 = Debug|x64
350352
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Debug|x86.ActiveCfg = Debug|Gaming.Desktop.x64
351353
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Release|ARM.ActiveCfg = Release|Gaming.Desktop.x64
352354
{A5A6E02A-21BA-4D55-9FB9-7B24DEDD3743}.Release|ARM.Build.0 = Release|Gaming.Desktop.x64

0 commit comments

Comments
 (0)