From 11e021f9f8c23465743bf3dd4f3a71773fcd78e4 Mon Sep 17 00:00:00 2001
From: sbrajchuk <78134229+sbrajchuk@users.noreply.github.com>
Date: Tue, 29 Nov 2022 22:38:53 +0300
Subject: [PATCH] [vcpkg] Add support of -static-md to Visual Studio UI
(#28045)
* Add support of -static-md to UI
* Remove redundant comparison
* Fix typo
* Check if 'Use Static Libraries' is selected
---
scripts/buildsystems/msbuild/vcpkg-general.xml | 5 ++++-
scripts/buildsystems/msbuild/vcpkg.targets | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/scripts/buildsystems/msbuild/vcpkg-general.xml b/scripts/buildsystems/msbuild/vcpkg-general.xml
index 5c84aa0daa..32610684d5 100644
--- a/scripts/buildsystems/msbuild/vcpkg-general.xml
+++ b/scripts/buildsystems/msbuild/vcpkg-general.xml
@@ -62,8 +62,11 @@
+
+
+ Description="Specifies the triplet used by Vcpkg. Does not include the '-static' or '-static-md' suffixes that may be added by the 'Use static libraries' and 'Use Dynamic CRT' flags." />
diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets
index 9719f388ee..91c3e56d10 100644
--- a/scripts/buildsystems/msbuild/vcpkg.targets
+++ b/scripts/buildsystems/msbuild/vcpkg.targets
@@ -38,7 +38,10 @@
<_ZVcpkgLinkage />
<_ZVcpkgLinkage Condition="'$(VcpkgUseStatic)' == 'true'">-static
- $(VcpkgPlatformTarget)-$(VcpkgOSTarget)$(_ZVcpkgLinkage)
+ <_ZVcpkgLinkageMD />
+ <_ZVcpkgLinkageMD Condition="'$(VcpkgUseStatic)' == 'true' and '$(VcpkgUseMD)' == 'true'">-md
+ $(VcpkgPlatformTarget)-$(VcpkgOSTarget)$(_ZVcpkgLinkage)$(_ZVcpkgLinkageMD)
+ $(VcpkgTriplet)$(_ZVcpkgLinkage)$(_ZVcpkgLinkageMD)