summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2023-08-28 09:04:33 +0800
committerGitHub <[email protected]>2023-08-28 09:04:33 +0800
commita0e464bebf1ddd493ca33d381da399b12dfc8358 (patch)
treed758fde0f00727ce9e664f7fa90a9ae2ea63ea50 /xmake/modules
parent2c894cb2c8062e6291d0b2fc4dafebef018f8003 (diff)
parentc682992ea53d296667953314ada87ddaf8584f30 (diff)
Merge pull request #4129 from xmake-io/emcc
improve the ignored configs for buildhash
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/private/action/require/impl/package.lua7
-rw-r--r--xmake/modules/private/action/require/impl/utils/requirekey.lua5
2 files changed, 5 insertions, 7 deletions
diff --git a/xmake/modules/private/action/require/impl/package.lua b/xmake/modules/private/action/require/impl/package.lua
index 4a94677b4..77b4abbd0 100644
--- a/xmake/modules/private/action/require/impl/package.lua
+++ b/xmake/modules/private/action/require/impl/package.lua
@@ -502,8 +502,9 @@ function _init_requireinfo(requireinfo, package, opt)
requireinfo.configs.lto = requireinfo.configs.lto or project.policy("build.optimization.lto")
end
-- but we will ignore some configs for buildhash in the headeronly and host/binary package
+ -- @note on_test still need these configs, @see https://github.com/xmake-io/xmake/issues/4124
if package:is_headeronly() or (package:is_binary() and not package:is_cross()) then
- requireinfo.ignored_configs = {"vs_runtime", "toolchains", "lto", "pic"}
+ requireinfo.ignored_configs_for_buildhash = {"vs_runtime", "toolchains", "lto", "pic"}
end
end
@@ -1151,9 +1152,9 @@ function get_configs_str(package)
if requireinfo.kind then
table.insert(configs, requireinfo.kind)
end
- local ignored_configs = hashset.from(requireinfo.ignored_configs or {})
+ local ignored_configs_for_buildhash = hashset.from(requireinfo.ignored_configs_for_buildhash or {})
for k, v in pairs(requireinfo.configs) do
- if not ignored_configs:has(k) then
+ if not ignored_configs_for_buildhash:has(k) then
if type(v) == "boolean" then
table.insert(configs, k .. ":" .. (v and "y" or "n"))
else
diff --git a/xmake/modules/private/action/require/impl/utils/requirekey.lua b/xmake/modules/private/action/require/impl/utils/requirekey.lua
index e44679f92..45adac2b4 100644
--- a/xmake/modules/private/action/require/impl/utils/requirekey.lua
+++ b/xmake/modules/private/action/require/impl/utils/requirekey.lua
@@ -52,14 +52,11 @@ function main(requireinfo, opt)
if key:startswith("/") then
key = key:sub(2)
end
- local ignored_configs = hashset.from(requireinfo.ignored_configs or {})
local configs = requireinfo.configs
if configs then
local configs_order = {}
for k, v in pairs(configs) do
- if not ignored_configs:has(k) then
- table.insert(configs_order, k .. "=" .. tostring(v))
- end
+ table.insert(configs_order, k .. "=" .. tostring(v))
end
table.sort(configs_order)
key = key .. ":" .. string.serialize(configs_order, true)