Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed VCPKG_LOAD_VCVARS_ENV option to be used to disable vcvars loading #1511

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions azure-pipelines/e2e-ports/triplets/x64-no-vcvars.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_LOAD_VCVARS_ENV OFF)
7 changes: 7 additions & 0 deletions azure-pipelines/end-to-end-tests-dir/build-test-ports.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,10 @@ if ($firstMatch -lt 0) {
} elseif ($output.IndexOf($expected, $firstMatch + 1) -ge 0) {
throw 'Duplicated bad license'
}

Refresh-TestRoot
$output = Run-VcpkgAndCaptureOutput @commonArgs --overlay-ports="$PSScriptRoot/../e2e-ports/overlays" install vcpkg-hello-world-1:x64-no-vcvars
Throw-IfNotFailed
if ($output -notmatch 'Error code: 1') {
throw 'VCPKG_LOAD_VCVARS_ENV disables calling vcvars'
}
3 changes: 1 addition & 2 deletions src/vcpkg/commands.build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -861,8 +861,7 @@ namespace vcpkg

bool PreBuildInfo::using_vcvars() const
{
return (!external_toolchain_file.has_value() || load_vcvars_env) &&
(cmake_system_name.empty() || cmake_system_name == "WindowsStore");
return load_vcvars_env && (cmake_system_name.empty() || cmake_system_name == "WindowsStore");
}

Path PreBuildInfo::toolchain_file() const
Expand Down
Loading