diff options
Diffstat (limited to 'toolsrc/src/vcpkg/build.cpp')
| -rw-r--r-- | toolsrc/src/vcpkg/build.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/toolsrc/src/vcpkg/build.cpp b/toolsrc/src/vcpkg/build.cpp index 02d4c4a71..5b93242a1 100644 --- a/toolsrc/src/vcpkg/build.cpp +++ b/toolsrc/src/vcpkg/build.cpp @@ -499,6 +499,14 @@ namespace vcpkg::Build const BuildPackageConfig& config)
{
auto& fs = paths.get_filesystem();
+#if defined(_WIN32)
+ const fs::path& powershell_exe_path = paths.get_tool_exe("powershell-core");
+ if (!fs.exists(powershell_exe_path.parent_path() / "powershell.exe"))
+ {
+ fs.copy(powershell_exe_path, powershell_exe_path.parent_path() / "powershell.exe", fs::copy_options::none);
+ }
+#endif
+
const Triplet& triplet = spec.triplet();
const auto& triplet_file_path = paths.get_triplet_file_path(spec.triplet()).u8string();
@@ -516,8 +524,12 @@ namespace vcpkg::Build std::string command = make_build_cmd(paths, pre_build_info, config, triplet);
std::unordered_map<std::string, std::string> env = make_env_passthrough(pre_build_info);
+#if defined(_WIN32)
+ const int return_code =
+ System::cmd_execute_clean(command, env, powershell_exe_path.parent_path().u8string() + ";");
+#else
const int return_code = System::cmd_execute_clean(command, env);
-
+#endif
const auto buildtimeus = timer.microseconds();
const auto spec_string = spec.to_string();
@@ -597,6 +609,9 @@ namespace vcpkg::Build std::vector<AbiEntry> abi_tag_entries(dependency_abis.begin(), dependency_abis.end());
+#if defined(_WIN32)
+ abi_tag_entries.emplace_back(AbiEntry{"powershell", paths.get_tool_version("powershell-core")});
+#endif
abi_tag_entries.emplace_back(AbiEntry{"cmake", paths.get_tool_version(Tools::CMAKE)});
// If there is an unusually large number of files in the port then
|
