aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/zeroc-ice/change_to_mt.ps1
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/zeroc-ice/change_to_mt.ps1
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/zeroc-ice/change_to_mt.ps1')
-rw-r--r--vcpkg/ports/zeroc-ice/change_to_mt.ps153
1 files changed, 53 insertions, 0 deletions
diff --git a/vcpkg/ports/zeroc-ice/change_to_mt.ps1 b/vcpkg/ports/zeroc-ice/change_to_mt.ps1
new file mode 100644
index 0000000..9130609
--- /dev/null
+++ b/vcpkg/ports/zeroc-ice/change_to_mt.ps1
@@ -0,0 +1,53 @@
+
+$projFilePath = $args[0]
+$crtLinkage = $args[1]
+
+if($projFilePath)
+{
+ $xpath = "/rs:Project/rs:ItemGroup/rs:ProjectConfiguration"
+ $xmldoc = New-Object System.Xml.XmlDocument
+ $xmldoc.load($projFilePath)
+ $nsmgr = New-Object System.Xml.XmlNamespaceManager($xmldoc.NameTable);
+ $nsmgr.AddNamespace("rs", "http://schemas.microsoft.com/developer/msbuild/2003");
+ $root = $xmldoc.DocumentElement
+
+ foreach($conf in $root.ItemDefinitionGroup)
+ {
+ if($conf.Condition)
+ {
+ if(-Not ($conf.ClCompile.RuntimeLibrary))
+ {
+ $rtl = $xmldoc.CreateElement("RuntimeLibrary", $conf.ClCompile.NamespaceURI)
+ $conf.ClCompile.AppendChild($rtl)
+ }
+
+ if($conf.Condition.Contains("Debug"))
+ {
+ if($crtLinkage -eq "static")
+ {
+ $conf.ClCompile.RuntimeLibrary = "MultithreadedDebug"
+ }
+ else
+ {
+ $conf.ClCompile.RuntimeLibrary = "MultithreadedDebugDLL"
+ }
+ }
+ else
+ {
+ if($crtLinkage -eq "static")
+ {
+ $conf.ClCompile.RuntimeLibrary = "Multithreaded"
+ }
+ else
+ {
+ $conf.ClCompile.RuntimeLibrary = "MultithreadedDLL"
+ }
+ }
+ }
+ }
+ $xmldoc.save($projFilePath)
+}
+else
+{
+ Write-Error "Error: No path defined!"
+}