summaryrefslogtreecommitdiff
path: root/xmake/rules/utils/compiler_runtime/xmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2024-01-22 22:41:59 +0800
committerruki <[email protected]>2024-01-25 12:09:58 +0800
commit4f7105af06f2b9f390b3441328911b48cb35b7e9 (patch)
tree0bff8e691b26f1d97f35a5255d9b4070fcefa8f6 /xmake/rules/utils/compiler_runtime/xmake.lua
parent5d2f15a1004be7baaaeb08b2e196ad77c52f9647 (diff)
improve compile runtime rules
Diffstat (limited to 'xmake/rules/utils/compiler_runtime/xmake.lua')
-rw-r--r--xmake/rules/utils/compiler_runtime/xmake.lua17
1 files changed, 12 insertions, 5 deletions
diff --git a/xmake/rules/utils/compiler_runtime/xmake.lua b/xmake/rules/utils/compiler_runtime/xmake.lua
index f8e3d39d0..61681b235 100644
--- a/xmake/rules/utils/compiler_runtime/xmake.lua
+++ b/xmake/rules/utils/compiler_runtime/xmake.lua
@@ -21,11 +21,18 @@
-- define rule: utils.compiler.runtime
rule("utils.compiler.runtime")
on_config(function (target)
-
- -- set vs runtime
- local vs_runtime = get_config("vs_runtime")
- if vs_runtime and target:is_plat("windows") and not target:get("runtimes") then
- target:set("runtimes", vs_runtime)
+ local runtimes = get_config("runtimes")
+ if not runtimes and target:is_plat("windows") then
+ runtimes = get_config("vs_runtime")
+ end
+ if not runtimes and target:is_plat("android") then
+ runtimes = get_config("ndk_cxxstl")
+ end
+ if runtimes and not target:get("runtimes") then
+ if type(runtimes) == "string" then
+ runtimes = runtimes:split(",", {plain = true})
+ end
+ target:set("runtimes", runtimes)
end
end)