diff options
| author | ruki <[email protected]> | 2021-10-09 13:23:13 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-10-09 13:23:13 +0800 |
| commit | f9487fe520c7a3266cc5ce91576ec06c1520c93a (patch) | |
| tree | 597e40874aee53d295a3d98a7f318f34de4497be | |
| parent | 62ce99d893b8eefcc30415b4154619ecf749e7a6 (diff) | |
Update target.lua
| -rw-r--r-- | xmake/rules/rust/build/target.lua | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/xmake/rules/rust/build/target.lua b/xmake/rules/rust/build/target.lua index 67917ad29..a1f34beff 100644 --- a/xmake/rules/rust/build/target.lua +++ b/xmake/rules/rust/build/target.lua @@ -21,19 +21,13 @@ -- imports import("core.base.option") import("core.base.hashset") -import("core.theme.theme") import("core.tool.compiler") import("core.project.depend") +import("utils.progress") -- build the source files function build_sourcefiles(target, sourcebatch, opt) - -- is verbose? - local verbose = option.get("verbose") - - -- get progress range - local progress = assert(opt.progress, "no progress!") - -- get the target file local targetfile = target:targetfile() @@ -60,17 +54,10 @@ function build_sourcefiles(target, sourcebatch, opt) end -- trace progress into - cprintf("${color.build.progress}" .. theme.get("text.build.progress_format") .. ":${clear} ", progress) - if verbose then - cprint("${dim color.build.target}linking.$(mode) %s", path.filename(targetfile)) - else - cprint("${color.build.target}linking.$(mode) %s", path.filename(targetfile)) - end + progress.show(opt.progress, "${color.build.target}linking.$(mode) %s", path.filename(targetfile)) -- trace verbose info - if verbose then - print(compinst:buildcmd(sourcefiles, targetfile, {target = target, compflags = compflags})) - end + vprint(compinst:buildcmd(sourcefiles, targetfile, {target = target, compflags = compflags})) -- flush io buffer to update progress info io.flush() |
