mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-06-07 11:38:58 +08:00
Specify GIT only when VCPKG_FORCE_SYSTEM_BINARIES is set (#6143)
This commit is contained in:
parent
95b94ec3b1
commit
48f22127e8
@ -362,24 +362,31 @@ namespace vcpkg::Build
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Toolset& toolset = paths.get_toolset(pre_build_info);
|
const Toolset& toolset = paths.get_toolset(pre_build_info);
|
||||||
|
|
||||||
|
std::vector<System::CMakeVariable> variables {
|
||||||
|
{"CMD", "BUILD"},
|
||||||
|
{"PORT", config.scf.core_paragraph->name},
|
||||||
|
{"CURRENT_PORT_DIR", config.port_dir},
|
||||||
|
{"TARGET_TRIPLET", spec.triplet().canonical_name()},
|
||||||
|
{"VCPKG_PLATFORM_TOOLSET", toolset.version.c_str()},
|
||||||
|
{"VCPKG_USE_HEAD_VERSION",
|
||||||
|
Util::Enum::to_bool(config.build_package_options.use_head_version) ? "1" : "0"},
|
||||||
|
{"DOWNLOADS", paths.downloads},
|
||||||
|
{"_VCPKG_NO_DOWNLOADS", !Util::Enum::to_bool(config.build_package_options.allow_downloads) ? "1" : "0"},
|
||||||
|
{"_VCPKG_DOWNLOAD_TOOL", to_string(config.build_package_options.download_tool)},
|
||||||
|
{"FEATURES", Strings::join(";", config.feature_list)},
|
||||||
|
{"ALL_FEATURES", all_features},
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!System::get_environment_variable("VCPKG_FORCE_SYSTEM_BINARIES").has_value())
|
||||||
|
{
|
||||||
|
variables.push_back({"GIT", git_exe_path});
|
||||||
|
}
|
||||||
|
|
||||||
const std::string cmd_launch_cmake = System::make_cmake_cmd(
|
const std::string cmd_launch_cmake = System::make_cmake_cmd(
|
||||||
cmake_exe_path,
|
cmake_exe_path,
|
||||||
paths.ports_cmake,
|
paths.ports_cmake,
|
||||||
{
|
variables);
|
||||||
{"CMD", "BUILD"},
|
|
||||||
{"PORT", config.scf.core_paragraph->name},
|
|
||||||
{"CURRENT_PORT_DIR", config.port_dir},
|
|
||||||
{"TARGET_TRIPLET", spec.triplet().canonical_name()},
|
|
||||||
{"VCPKG_PLATFORM_TOOLSET", toolset.version.c_str()},
|
|
||||||
{"VCPKG_USE_HEAD_VERSION",
|
|
||||||
Util::Enum::to_bool(config.build_package_options.use_head_version) ? "1" : "0"},
|
|
||||||
{"DOWNLOADS", paths.downloads},
|
|
||||||
{"_VCPKG_NO_DOWNLOADS", !Util::Enum::to_bool(config.build_package_options.allow_downloads) ? "1" : "0"},
|
|
||||||
{"_VCPKG_DOWNLOAD_TOOL", to_string(config.build_package_options.download_tool)},
|
|
||||||
{"GIT", git_exe_path},
|
|
||||||
{"FEATURES", Strings::join(";", config.feature_list)},
|
|
||||||
{"ALL_FEATURES", all_features},
|
|
||||||
});
|
|
||||||
|
|
||||||
auto command = make_build_env_cmd(pre_build_info, toolset);
|
auto command = make_build_env_cmd(pre_build_info, toolset);
|
||||||
if (!command.empty())
|
if (!command.empty())
|
||||||
|
Loading…
Reference in New Issue
Block a user