diff options
| author | ruki <[email protected]> | 2021-08-22 21:35:23 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-08-22 21:35:49 +0800 |
| commit | df288a44eb6c8277d250306add709f9f5f59f0cd (patch) | |
| tree | db9fd22b116c7966e7df845e0d6cd4f81e3523cf /xmake/actions/build/kinds/binary.lua | |
| parent | edf32980cd66c2ee5075ddd9e4a08c7e50f6985e (diff) | |
link metallib
Diffstat (limited to 'xmake/actions/build/kinds/binary.lua')
| -rw-r--r-- | xmake/actions/build/kinds/binary.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/xmake/actions/build/kinds/binary.lua b/xmake/actions/build/kinds/binary.lua index dd72fc21a..b84b518de 100644 --- a/xmake/actions/build/kinds/binary.lua +++ b/xmake/actions/build/kinds/binary.lua @@ -25,6 +25,7 @@ import("core.tool.linker") import("core.tool.compiler") import("core.project.depend") import("private.utils.progress") +import("private.utils.batchcmds") import("object", {alias = "add_batchjobs_for_object"}) -- do link target @@ -87,6 +88,13 @@ function _on_link_target(target, opt) on_link(target, opt) done = true end + local on_linkcmd = r:script("linkcmd") + if on_linkcmd then + local batchcmds_ = batchcmds.new({target = target}) + on_linkcmd(target, batchcmds_, {progress = opt.progress}) + batchcmds_:runcmds({dryrun = option.get("dry-run")}) + done = true + end end if done then return end @@ -109,6 +117,12 @@ function _link_target(target, opt) if before_link then before_link(target, opt) end + local before_linkcmd = r:script("linkcmd_before") + if before_linkcmd then + local batchcmds_ = batchcmds.new({target = target}) + before_linkcmd(target, batchcmds_, {progress = opt.progress}) + batchcmds_:runcmds({dryrun = option.get("dry-run")}) + end end -- on link @@ -126,6 +140,12 @@ function _link_target(target, opt) if after_link then after_link(target, opt) end + local after_linkcmd = r:script("linkcmd_after") + if after_linkcmd then + local batchcmds_ = batchcmds.new({target = target}) + after_linkcmd(target, batchcmds_, {progress = opt.progress}) + batchcmds_:runcmds({dryrun = option.get("dry-run")}) + end end end |
