diff options
| author | ruki <[email protected]> | 2022-12-15 00:59:29 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-12-15 00:59:29 +0800 |
| commit | e4d16ae4ade7f1dc2c1f628ab4509b1c4a1962ed (patch) | |
| tree | 736b523675552bcc5766a336214b07181c52de13 | |
| parent | b57c41d25fcaa543564ed4e2da9563e30b66d0b4 (diff) | |
fix build files twice #3171
| -rw-r--r-- | xmake/actions/build/kinds/object.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/xmake/actions/build/kinds/object.lua b/xmake/actions/build/kinds/object.lua index 01fbb5a05..05fdc939c 100644 --- a/xmake/actions/build/kinds/object.lua +++ b/xmake/actions/build/kinds/object.lua @@ -177,6 +177,22 @@ end -- add batch jobs for target function _add_batchjobs_for_target(batchjobs, rootjob, target, sourcebatch, suffix) + -- we just build sourcebatch with on_build_files scripts + -- + -- for example, c++.build and c++.build.modules.builder rules have same sourcefiles, + -- but we just build it for c++.build + -- + -- @see https://github.com/xmake-io/xmake/issues/3171 + -- + local rulename = sourcebatch.rulename + if rulename then + local ruleinst = _get_rule(target, rulename) + if not ruleinst:script("build_file") and + not ruleinst:script("build_files") then + return + end + end + -- add batch jobs local scriptname = "build_files" .. (suffix and ("_" .. suffix) or "") local script = target:script(scriptname) |
