From 1174c9ea1d02461e52be88ac932b3d7410e3ffe6 Mon Sep 17 00:00:00 2001 From: Billy O'Neal Date: Fri, 24 Mar 2023 22:35:58 -0700 Subject: [PATCH] [vcpkg-msbuild] Add a switch to disable classic mode for one-liner and in-VS installs. (#30373) --- scripts/buildsystems/msbuild/vcpkg.props | 3 +++ scripts/buildsystems/msbuild/vcpkg.targets | 15 ++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/scripts/buildsystems/msbuild/vcpkg.props b/scripts/buildsystems/msbuild/vcpkg.props index f728dc737f..0f0b6e3b35 100644 --- a/scripts/buildsystems/msbuild/vcpkg.props +++ b/scripts/buildsystems/msbuild/vcpkg.props @@ -35,6 +35,9 @@ false true + + true + false true diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 2217c25d09..361850bd83 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -24,6 +24,11 @@ <_ZVcpkgInstalledDir Condition="'$(_ZVcpkgInstalledDir)' != '' and !$(_ZVcpkgInstalledDir.EndsWith('\'))">$(_ZVcpkgInstalledDir)\ + + <_ZVcpkgClassicOrManifest Condition="'$(VcpkgEnabled)' == 'true' And ('$(VcpkgEnableClassic)' == 'true' Or '$(VcpkgEnableManifest)' == 'true')">true + <_ZVcpkgClassicOrManifest Condition="'$(_ZVcpkgClassicOrManifest)' == ''">false + + windows @@ -88,7 +93,7 @@ <_ZVcpkgConfigSubdir Condition="'$(_ZVcpkgNormalizedConfiguration)' == 'Debug'">debug\ <_ZVcpkgExecutable>$(_ZVcpkgRoot)vcpkg.exe - $(ExternalIncludePath);$(_ZVcpkgCurrentInstalledDir)include + $(ExternalIncludePath);$(_ZVcpkgCurrentInstalledDir)include @@ -103,7 +108,7 @@ - + %(AdditionalLibraryDirectories);$(_ZVcpkgCurrentInstalledDir)$(_ZVcpkgConfigSubdir)lib;$(_ZVcpkgCurrentInstalledDir)$(_ZVcpkgConfigSubdir)lib\manual-link @@ -126,7 +131,7 @@ Importance="High" Condition="'$(VcpkgEnableManifest)' != 'true' and '$(_ZVcpkgManifestRoot)' != ''" /> - + $(_ZVcpkgInstalledDir).msbuildstamp-$(VcpkgTriplet).$(_ZVcpkgHostTripletSuffix)stamp - + <_ZVcpkgInstallManifestDependenciesInputs Include="$(_ZVcpkgManifestFileLocation)"/> <_ZVcpkgInstallManifestDependenciesInputs Include="$(_ZVcpkgConfigurationFileLocation)" Condition="Exists('$(_ZVcpkgConfigurationFileLocation)')"/> @@ -191,7 +196,7 @@ + Condition="'$(_ZVcpkgClassicOrManifest)' == 'true' and '$(VcpkgApplocalDeps)' == 'true' and '$(LinkSkippedExecution)' != 'true'"> <_ZVcpkgAppLocalPowerShellCommonArguments>-ExecutionPolicy Bypass -noprofile -File "$(MSBuildThisFileDirectory)applocal.ps1" "$(TargetPath)" "$(_ZVcpkgCurrentInstalledDir)$(_ZVcpkgConfigSubdir)bin" "$(TLogLocation)$(ProjectName).write.1u.tlog" "$(IntDir)vcpkg.applocal.log"