diff options
| -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 |
