Skip to content

Commit 7ef0108

Browse files
authored
xbox updates for October 2025 release new layout (#1834)
1 parent 7d1dc0d commit 7ef0108

File tree

5 files changed

+37
-13
lines changed

5 files changed

+37
-13
lines changed

include/vcpkg/base/contractual-constants.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ namespace vcpkg
448448
inline constexpr StringLiteral CMakeVariableXBoxConsoleTarget = "VCPKG_XBOX_CONSOLE_TARGET";
449449
inline constexpr StringLiteral CMakeVariableZChainloadToolchainFile = "Z_VCPKG_CHAINLOAD_TOOLCHAIN_FILE";
450450
inline constexpr StringLiteral CMakeVariableZVcpkgGameDKLatest = "Z_VCPKG_GameDKLatest";
451+
inline constexpr StringLiteral CMakeVariableZVcpkgGameDKXboxLatest = "Z_VCPKG_GameDKXboxLatest";
451452
inline constexpr StringLiteral CMakeVariableZPostPortfileIncludes = "Z_VCPKG_POST_PORTFILE_INCLUDES";
452453

453454
// Policies are PascalCase

include/vcpkg/commands.build.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ namespace vcpkg
170170
std::vector<Path> hash_additional_files;
171171
std::vector<Path> post_portfile_includes;
172172
Optional<Path> gamedk_latest_path;
173+
Optional<Path> gamedk_xbox_latest_path;
173174

174175
Path toolchain_file() const;
175176
bool using_vcvars() const;

src/vcpkg/base/system.process.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,8 @@ namespace vcpkg
635635
"GameDKLatest",
636636
"GRDKLatest",
637637
"GXDKLatest",
638+
"GameDKCoreLatest",
639+
"GameDKXboxLatest",
638640
};
639641

640642
std::vector<std::string> env_prefix_string = {

src/vcpkg/cmakevars.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ VCPKG_HASH_ADDITIONAL_FILES=${VCPKG_HASH_ADDITIONAL_FILES}
174174
VCPKG_POST_PORTFILE_INCLUDES=${VCPKG_POST_PORTFILE_INCLUDES}
175175
VCPKG_XBOX_CONSOLE_TARGET=${VCPKG_XBOX_CONSOLE_TARGET}
176176
Z_VCPKG_GameDKLatest=$ENV{GameDKLatest}
177+
Z_VCPKG_GameDKXboxLatest=$ENV{GameDKXboxLatest}
177178
e1e74b5c-18cb-4474-a6bd-5c1c8bc81f3f
178179
8c504940-be29-4cba-9f8f-6cd83e9d87b7")
179180
endfunction()

src/vcpkg/commands.build.cpp

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,24 +1279,42 @@ namespace vcpkg
12791279
return result;
12801280
}
12811281

1282+
static Optional<Path> get_grdk_header_path(const PreBuildInfo& pre_build_info)
1283+
{
1284+
// Handles new layouts for October 2025 or later.
1285+
if (auto game_dk_xbox_latest = pre_build_info.gamedk_xbox_latest_path.get())
1286+
{
1287+
return *game_dk_xbox_latest / "xbox/include/gxdk.h";
1288+
}
1289+
1290+
// Handles old layouts for April 2025 or earlier for backwards compatibility.
1291+
if (auto game_dk_latest = pre_build_info.gamedk_latest_path.get())
1292+
{
1293+
return *game_dk_latest / "GRDK/gameKit/Include/grdk.h";
1294+
}
1295+
1296+
return nullopt;
1297+
}
1298+
12821299
static std::string grdk_hash(const Filesystem& fs,
12831300
Cache<Path, Optional<std::string>>& grdk_cache,
12841301
const PreBuildInfo& pre_build_info)
12851302
{
1286-
if (auto game_dk_latest = pre_build_info.gamedk_latest_path.get())
1303+
auto maybe_gxdk_header_path = get_grdk_header_path(pre_build_info);
1304+
if (auto gxdk_header_path = maybe_gxdk_header_path.get())
12871305
{
1288-
const auto grdk_header_path = *game_dk_latest / "GRDK/gameKit/Include/grdk.h";
1289-
const auto& maybe_header_hash = grdk_cache.get_lazy(grdk_header_path, [&]() -> Optional<std::string> {
1290-
auto maybe_hash = Hash::get_file_hash(fs, grdk_header_path, Hash::Algorithm::Sha256);
1291-
if (auto hash = maybe_hash.get())
1292-
{
1293-
return std::move(*hash);
1294-
}
1295-
else
1296-
{
1297-
return nullopt;
1298-
}
1299-
});
1306+
const auto& maybe_header_hash =
1307+
grdk_cache.get_lazy(*gxdk_header_path, [&fs, gxdk_header_path]() -> Optional<std::string> {
1308+
auto maybe_hash = Hash::get_file_hash(fs, *gxdk_header_path, Hash::Algorithm::Sha256);
1309+
if (auto hash = maybe_hash.get())
1310+
{
1311+
return std::move(*hash);
1312+
}
1313+
else
1314+
{
1315+
return nullopt;
1316+
}
1317+
});
13001318

13011319
if (auto header_hash = maybe_header_hash.get())
13021320
{
@@ -2231,6 +2249,7 @@ namespace vcpkg
22312249
}
22322250

22332251
Util::assign_if_set_and_nonempty(gamedk_latest_path, cmakevars, CMakeVariableZVcpkgGameDKLatest);
2252+
Util::assign_if_set_and_nonempty(gamedk_xbox_latest_path, cmakevars, CMakeVariableZVcpkgGameDKXboxLatest);
22342253
}
22352254

22362255
ExtendedBuildResult::ExtendedBuildResult(BuildResult code) : code(code) { }

0 commit comments

Comments
 (0)