diff options
| author | ruki <[email protected]> | 2025-06-27 13:14:57 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-27 13:14:57 +0800 |
| commit | 6341e551e5543349a6bec3ee7636a9065a8b7b0d (patch) | |
| tree | f52b03e9e6f8c28f64b512f3f3bd9bce7de37cb2 /xmake/modules | |
| parent | e2c60ab5bc58d4e0a769591b1ad58285d638ccca (diff) | |
| parent | 3e793c4de711bf7870ad12b6fefb1603d0047e57 (diff) | |
Merge pull request #6592 from xmake-io/objectonly
Fix objectonly targets
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/private/action/build/build_binary.lua | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/xmake/modules/private/action/build/build_binary.lua b/xmake/modules/private/action/build/build_binary.lua index 3863b8550..a29ed4f60 100644 --- a/xmake/modules/private/action/build/build_binary.lua +++ b/xmake/modules/private/action/build/build_binary.lua @@ -28,11 +28,15 @@ function main(jobgraph, target, opt) jobgraph:group(objects_group, function () build_object(jobgraph, target, opt) end) - if jobgraph:size() > jobsize then - local link_group = target:fullname() .. "/link" - jobgraph:group(link_group, function () - target_buildutils.add_linkjobs(jobgraph, target, opt) - end) + local has_object_jobs = jobgraph:size() > jobsize + + -- @note We always need the link task, even if the current target does not have any object files + -- https://github.com/xmake-io/xmake-repo/pull/7479#issuecomment-3007049158 + local link_group = target:fullname() .. "/link" + jobgraph:group(link_group, function () + target_buildutils.add_linkjobs(jobgraph, target, opt) + end) + if has_object_jobs then jobgraph:add_orders(objects_group, link_group) end end |
