Don't emit the 'vs prompt' warning when targeting arm64ec from an arm64 developer command prompt. (#1581)

This commit is contained in:
Billy O'Neal 2025-01-27 11:39:20 -08:00 коммит произвёл GitHub
Родитель c79ccaa466
Коммит 0e17cc35e5
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 11 добавлений и 9 удалений

Просмотреть файл

@ -1301,20 +1301,22 @@ namespace vcpkg
#if defined(_WIN32) #if defined(_WIN32)
const auto maybe_common_triplet = Util::common_projection( const auto maybe_common_triplet = Util::common_projection(
action_plan.install_actions, [](const InstallPlanAction& to_install) { return to_install.spec.triplet(); }); action_plan.install_actions, [](const InstallPlanAction& to_install) { return to_install.spec.triplet(); });
if (maybe_common_triplet) if (auto common_triplet = maybe_common_triplet.get())
{ {
const auto& common_triplet = maybe_common_triplet.value_or_exit(VCPKG_LINE_INFO); const auto maybe_common_arch = common_triplet->guess_architecture();
const auto maybe_common_arch = common_triplet.guess_architecture(); if (auto common_arch = maybe_common_arch.get())
if (maybe_common_arch)
{ {
const auto maybe_vs_prompt = guess_visual_studio_prompt_target_architecture(); const auto maybe_vs_prompt = guess_visual_studio_prompt_target_architecture();
if (maybe_vs_prompt) if (auto vs_prompt = maybe_vs_prompt.get())
{ {
const auto common_arch = maybe_common_arch.value_or_exit(VCPKG_LINE_INFO); // There is no "Developer Command Prompt for ARM64EC". ARM64EC and ARM64 use the same developer
const auto vs_prompt = maybe_vs_prompt.value_or_exit(VCPKG_LINE_INFO); // command prompt, and compiler toolset version. The only difference is adding a /arm64ec switch to
if (common_arch != vs_prompt) // the build
if (*common_arch != *vs_prompt &&
!(*common_arch == CPUArchitecture::ARM64EC && *vs_prompt == CPUArchitecture::ARM64))
{ {
msg::println_warning(msgVcpkgInVsPrompt, msg::value = vs_prompt, msg::triplet = common_triplet); msg::println_warning(
msgVcpkgInVsPrompt, msg::value = *vs_prompt, msg::triplet = *common_triplet);
} }
} }
} }