Skip to content

Commit

Permalink
Move toolchain decision making entirely into the tool (#350)
Browse files Browse the repository at this point in the history
* Move toolchain decision making entirely into the tool

* Update src/vcpkg/build.cpp

Co-authored-by: Billy O'Neal <[email protected]>

Co-authored-by: Billy O'Neal <[email protected]>
  • Loading branch information
ras0219-msft and BillyONeal authored Feb 17, 2022
1 parent f562635 commit f3841c4
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/vcpkg/build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,7 @@ namespace vcpkg::Build
{"_VCPKG_DOWNLOAD_TOOL", to_string(action.build_options.download_tool)},
{"_VCPKG_EDITABLE", Util::Enum::to_bool(action.build_options.editable) ? "1" : "0"},
{"_VCPKG_NO_DOWNLOADS", !Util::Enum::to_bool(action.build_options.allow_downloads) ? "1" : "0"},
{"VCPKG_CHAINLOAD_TOOLCHAIN_FILE", action.pre_build_info(VCPKG_LINE_INFO).toolchain_file()},
};

if (action.build_options.download_tool == DownloadTool::ARIA2)
Expand Down Expand Up @@ -853,7 +854,21 @@ namespace vcpkg::Build
{
return m_paths.scripts / "toolchains/mingw.cmake";
}
else if (cmake_system_name.empty() || cmake_system_name == "Windows" || cmake_system_name == "WindowsStore")
else if (cmake_system_name == "WindowsStore")
{
// HACK: remove once we have fully shipped a uwp toolchain
static bool have_uwp_triplet =
m_paths.get_filesystem().exists(m_paths.scripts / "toolchains/uwp.cmake", IgnoreErrors{});
if (have_uwp_triplet)
{
return m_paths.scripts / "toolchains/uwp.cmake";
}
else
{
return m_paths.scripts / "toolchains/windows.cmake";
}
}
else if (cmake_system_name.empty() || cmake_system_name == "Windows")
{
return m_paths.scripts / "toolchains/windows.cmake";
}
Expand Down

0 comments on commit f3841c4

Please sign in to comment.