diff options
| author | ruki <[email protected]> | 2020-03-14 00:28:36 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-03-13 20:51:38 +0800 |
| commit | 1925d9171b2dce49cb95e5816fd38bc103a44be3 (patch) | |
| tree | 562d69de480b5cda4842a6d3c46088a3156a92e9 | |
| parent | 87272da2962c65216670860a2390638c4516841b (diff) | |
improve go rule
| -rw-r--r-- | xmake/actions/build/kinds/object.lua | 2 | ||||
| -rw-r--r-- | xmake/rules/go/build/object.lua | 8 | ||||
| -rw-r--r-- | xmake/rules/go/xmake.lua | 2 |
3 files changed, 3 insertions, 9 deletions
diff --git a/xmake/actions/build/kinds/object.lua b/xmake/actions/build/kinds/object.lua index f9fcba8b1..df1347686 100644 --- a/xmake/actions/build/kinds/object.lua +++ b/xmake/actions/build/kinds/object.lua @@ -40,7 +40,7 @@ function _add_batchjobs_for_rule(batchjobs, rootjob, target, sourcebatch, suffix script(target, batchjobs, sourcebatch, {rootjob = rootjob}) else batchjobs:addjob("rule/" .. rulename .. "/" .. scriptname, function (index, total) - script(target, batchjobs, sourcebatch, {progress = (index * 100) / total}) + script(target, sourcebatch, {progress = (index * 100) / total}) end, rootjob) end else diff --git a/xmake/rules/go/build/object.lua b/xmake/rules/go/build/object.lua index e32a3f98b..697ae8f2f 100644 --- a/xmake/rules/go/build/object.lua +++ b/xmake/rules/go/build/object.lua @@ -26,7 +26,7 @@ import("core.tool.compiler") import("core.project.depend") -- build the source files -function _build_sourcefiles(target, sourcebatch, opt) +function main(target, sourcebatch, opt) -- is verbose? local verbose = option.get("verbose") @@ -95,9 +95,3 @@ function _build_sourcefiles(target, sourcebatch, opt) depend.save(dependinfo, dependfile) end --- add batch jobs to build the source files -function main(target, batchjobs, sourcebatch, opt) - return batchjobs:addjob(target:name() .. "/build_files", function (index, total) - _build_sourcefiles(target, sourcebatch, {progress = (index * 100) / total}) - end, opt.rootjob) -end diff --git a/xmake/rules/go/xmake.lua b/xmake/rules/go/xmake.lua index 87c04aece..b7610b0f6 100644 --- a/xmake/rules/go/xmake.lua +++ b/xmake/rules/go/xmake.lua @@ -21,7 +21,7 @@ -- define rule: go.build rule("go.build") set_sourcekinds("gc") - on_build_files("build.object", {batch = true}) + on_build_files("build.object") -- define rule: cpp rule("go") |
