@@ -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