From 6f05013ae1fcf9f050d949796c2d74b7aa27c1d9 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 23 Jan 2024 23:16:26 +0800 Subject: fix vs_runtime readonly --- xmake/modules/private/action/require/impl/package.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 -- cgit v1.3.1