Introduced environment variable "VCPKG_DEFAULT_TRIPLET"

This commit is contained in:
Albert Ziegenhagel 2016-09-22 12:00:27 +02:00
parent 23a45e7db6
commit eba6126d15
2 changed files with 11 additions and 2 deletions

View File

@ -32,7 +32,7 @@ namespace vcpkg
//"\n"
"Options:\n"
" --triplet <t> Specify the target architecture triplet.\n"
" (default: x86-windows, see 'vcpkg help triplet')\n"
" (default: %%VCPKG_DEFAULT_TRIPLET%%, see 'vcpkg help triplet')\n"
"\n"
" --vcpkg-root <path> Specify the vcpkg root directory\n"
" (default: %%VCPKG_ROOT%%)\n"

View File

@ -69,7 +69,16 @@ static void inner(const vcpkg_cmd_arguments& args)
return command_function(args, paths);
}
triplet default_target_triplet = triplet::X86_WINDOWS;
triplet default_target_triplet;
const auto vcpkg_default_triplet_env = System::wdupenv_str(L"VCPKG_DEFAULT_TRIPLET");
if(!vcpkg_default_triplet_env.empty())
{
default_target_triplet = {std::string(vcpkg_default_triplet_env.begin(), vcpkg_default_triplet_env.end())};
}
else
{
default_target_triplet = triplet::X86_WINDOWS;
}
if (args.target_triplet != nullptr)
{