Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/vcpkg/base/contractual-constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ namespace vcpkg
inline constexpr StringLiteral CMakeVariableXBoxConsoleTarget = "VCPKG_XBOX_CONSOLE_TARGET";
inline constexpr StringLiteral CMakeVariableZChainloadToolchainFile = "Z_VCPKG_CHAINLOAD_TOOLCHAIN_FILE";
inline constexpr StringLiteral CMakeVariableZVcpkgGameDKLatest = "Z_VCPKG_GameDKLatest";
inline constexpr StringLiteral CMakeVariableZVcpkgGameDKXboxLatest = "Z_VCPKG_GameDKXboxLatest";
inline constexpr StringLiteral CMakeVariableZPostPortfileIncludes = "Z_VCPKG_POST_PORTFILE_INCLUDES";

// Policies are PascalCase
Expand Down
1 change: 1 addition & 0 deletions include/vcpkg/commands.build.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ namespace vcpkg
std::vector<Path> hash_additional_files;
std::vector<Path> post_portfile_includes;
Optional<Path> gamedk_latest_path;
Optional<Path> gamedk_xbox_latest_path;

Path toolchain_file() const;
bool using_vcvars() const;
Expand Down
2 changes: 2 additions & 0 deletions src/vcpkg/base/system.process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,8 @@ namespace vcpkg
"GameDKLatest",
"GRDKLatest",
"GXDKLatest",
"GameDKCoreLatest",
"GameDKXboxLatest",
};

std::vector<std::string> env_prefix_string = {
Expand Down
1 change: 1 addition & 0 deletions src/vcpkg/cmakevars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ VCPKG_HASH_ADDITIONAL_FILES=${VCPKG_HASH_ADDITIONAL_FILES}
VCPKG_POST_PORTFILE_INCLUDES=${VCPKG_POST_PORTFILE_INCLUDES}
VCPKG_XBOX_CONSOLE_TARGET=${VCPKG_XBOX_CONSOLE_TARGET}
Z_VCPKG_GameDKLatest=$ENV{GameDKLatest}
Z_VCPKG_GameDKXboxLatest=$ENV{GameDKXboxLatest}
e1e74b5c-18cb-4474-a6bd-5c1c8bc81f3f
8c504940-be29-4cba-9f8f-6cd83e9d87b7")
endfunction()
Expand Down
24 changes: 24 additions & 0 deletions src/vcpkg/commands.build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,29 @@ namespace vcpkg
Cache<Path, Optional<std::string>>& grdk_cache,
const PreBuildInfo& pre_build_info)
{
// Handles new layouts for October 2025 or later.
if (auto game_dk_xbox_latest = pre_build_info.gamedk_xbox_latest_path.get())
{
const auto gxdk_header_path = *game_dk_xbox_latest / "xbox/include/gxdk.h";
const auto& maybe_header_hash = grdk_cache.get_lazy(gxdk_header_path, [&]() -> Optional<std::string> {
auto maybe_hash = Hash::get_file_hash(fs, gxdk_header_path, Hash::Algorithm::Sha256);
if (auto hash = maybe_hash.get())
{
return std::move(*hash);
}
else
{
return nullopt;
}
});

if (auto header_hash = maybe_header_hash.get())
{
return *header_hash;
}
}

// Handles old layouts for April 2025 or earlier for backwards compatibility.
if (auto game_dk_latest = pre_build_info.gamedk_latest_path.get())
{
const auto grdk_header_path = *game_dk_latest / "GRDK/gameKit/Include/grdk.h";
Expand Down Expand Up @@ -2231,6 +2254,7 @@ namespace vcpkg
}

Util::assign_if_set_and_nonempty(gamedk_latest_path, cmakevars, CMakeVariableZVcpkgGameDKLatest);
Util::assign_if_set_and_nonempty(gamedk_xbox_latest_path, cmakevars, CMakeVariableZVcpkgGameDKXboxLatest);
}

ExtendedBuildResult::ExtendedBuildResult(BuildResult code) : code(code) { }
Expand Down
Loading