summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-01-23 23:16:26 +0800
committerruki <[email protected]>2024-01-25 12:09:59 +0800
commit6f05013ae1fcf9f050d949796c2d74b7aa27c1d9 (patch)
tree2a4833dbf98bfb688dd8b3d5acdaa2e222cf44cd
parent10f28484e790d677b805361875060ebde662bdb2 (diff)
fix vs_runtime readonly
-rw-r--r--xmake/modules/private/action/require/impl/package.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua
index 7c6218f35..47ec0f8b5 100644
--- a/xmake/modules/private/action/require/impl/package.lua
+++ b/xmake/modules/private/action/require/impl/package.lua
@@ -578,7 +578,17 @@ function _finish_requireinfo(requireinfo, package)
for _, name in ipairs(table.keys(requireinfo.configs)) do
local current = requireinfo.configs[name]
local default = package:extraconf("configs", name, "default")
- if package:extraconf("configs", name, "readonly") and current ~= default then
+ local readonly = package:extraconf("configs", name, "readonly")
+ if name == "runtimes" then
+ -- vs_runtime is deprecated, but we need also support it now.
+ if default == nil then
+ default = package:extraconf("configs", "vs_runtime", "default")
+ end
+ if readonly == nil then
+ readonly = package:extraconf("configs", "vs_runtime", "readonly")
+ end
+ end
+ if readonly and current ~= default then
wprint("configs.%s is readonly in package(%s), it's always %s", name, package:name(), default)
-- package:config() will use default value after loading package
requireinfo.configs[name] = nil