summaryrefslogtreecommitdiff
path: root/xmake/rules/utils/compiler_runtime/xmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-04-09 00:57:47 +0800
committerruki <[email protected]>2025-04-09 00:57:47 +0800
commit40f2da18943f7f5e18f838365aebe633c32efc30 (patch)
tree638d67006bdd6d169b4474dc806a6e9303533d34 /xmake/rules/utils/compiler_runtime/xmake.lua
parent9d8707ae3fe665f5f33991f1088d707f334546e5 (diff)
improve vs runtime
Diffstat (limited to 'xmake/rules/utils/compiler_runtime/xmake.lua')
-rw-r--r--xmake/rules/utils/compiler_runtime/xmake.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/xmake/rules/utils/compiler_runtime/xmake.lua b/xmake/rules/utils/compiler_runtime/xmake.lua
index 1a50fddef..cd8d5297c 100644
--- a/xmake/rules/utils/compiler_runtime/xmake.lua
+++ b/xmake/rules/utils/compiler_runtime/xmake.lua
@@ -40,5 +40,16 @@ rule("utils.compiler.runtime")
end
target:set("runtimes", runtimes)
end
+
+ -- enable vs runtime as MD by default
+ if target:is_plat("windows") and not target:get("runtimes") then
+ local vs_runtime_default = target:policy("build.c++.msvc.runtime")
+ if vs_runtime_default and target:has_tool("cxx", "cl", "clang_cl") then
+ if is_mode("debug") then
+ vs_runtime_default = vs_runtime_default .. "d"
+ end
+ target:set("runtimes", vs_runtime_default)
+ end
+ end
end)