summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-10-04 17:30:32 +0800
committerruki <[email protected]>2025-10-04 17:30:32 +0800
commitd877bfa5f10301d59d0cf0b15246612e277e8d81 (patch)
tree81864bca8be1dbb0388644a83d20ed3b9fb1df9a
parentb884a432cad83ad43c8ecf130efa467533698bab (diff)
fix merge archive
-rw-r--r--xmake/rules/utils/merge_archive/xmake.lua15
1 files changed, 7 insertions, 8 deletions
diff --git a/xmake/rules/utils/merge_archive/xmake.lua b/xmake/rules/utils/merge_archive/xmake.lua
index 1d4fe78a2..ad5039a89 100644
--- a/xmake/rules/utils/merge_archive/xmake.lua
+++ b/xmake/rules/utils/merge_archive/xmake.lua
@@ -31,18 +31,17 @@ rule("utils.merge.archive")
dep:data_set("inherit.links.deplink", false)
end
end
- end
- local sourcefiles
- local sourcebatch = target:sourcebatches()["utils.merge.archive"]
- if sourcebatch and sourcebatch.sourcefiles then
- sourcefiles = sourcebatch.sourcefiles
- target:data_set("merge_archive.sourcefiles", sourcefiles)
- end
- if not (target:is_static() and (target:policy("build.merge_archive") or sourcefiles)) then
+ else
target:rule_enable("utils.merge.archive", false)
end
end)
+ on_build_files(function (target, sourcebatch, opt)
+ if sourcebatch.sourcefiles then
+ target:data_set("merge_archive.sourcefiles", sourcebatch.sourcefiles)
+ end
+ end)
+
after_link(function (target, opt)
if not target:is_static() then
return