summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-01-23 22:46:09 +0800
committerruki <[email protected]>2024-01-25 12:09:58 +0800
commitcb4f23888446db5392ca67219a370328b459693a (patch)
tree3898638fad48c6c4e7e37aa7747293bfe65658ee
parenta053cf76793f0b0ce3da1d709a0d10db4ec45a30 (diff)
improve package:config
-rw-r--r--xmake/core/package/package.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua
index d5e82b13f..e271cc64c 100644
--- a/xmake/core/package/package.lua
+++ b/xmake/core/package/package.lua
@@ -1391,6 +1391,19 @@ function _instance:config(name)
local configs = self:configs()
if configs then
value = configs[name]
+ -- vs_runtime is deprecated now
+ if name == "vs_runtime" then
+ local runtimes = configs.runtimes
+ if runtimes then
+ for _, item in ipairs(runtimes:split(",")) do
+ if item:startswith("MT") or item:startswith("MD") then
+ value = item
+ break
+ end
+ end
+ end
+ utils.warning("please use package:runtimes() or package:has_runtime() instead of package:config(\"vs_runtime\")")
+ end
end
return value
end