diff options
| author | ruki <[email protected]> | 2020-05-31 10:31:59 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-05-31 10:31:59 +0800 |
| commit | 6d67b96bf3977f9f9376e03195933638e75f92ba (patch) | |
| tree | b77a0db55b27c090a5e4a61eb86f7a9f6bc590e4 /xmake/modules/core/tools/sdcc.lua | |
| parent | aab3a9a8bf7c07cbf80d62c7bc5bc11c8cbf6fd3 (diff) | |
add ninja theme
Diffstat (limited to 'xmake/modules/core/tools/sdcc.lua')
| -rw-r--r-- | xmake/modules/core/tools/sdcc.lua | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/xmake/modules/core/tools/sdcc.lua b/xmake/modules/core/tools/sdcc.lua index 03879677c..af61b21e1 100644 --- a/xmake/modules/core/tools/sdcc.lua +++ b/xmake/modules/core/tools/sdcc.lua @@ -20,6 +20,7 @@ -- imports import("core.base.option") +import("private.utils.progress") -- init it function init(self) @@ -165,12 +166,12 @@ function link(self, objectfiles, targetkind, targetfile, flags) end -- make the compile arguments list -function _compargv1(self, sourcefile, objectfile, flags) +function compargv(self, sourcefile, objectfile, flags) return self:program(), table.join("-c", flags, "-o", objectfile, sourcefile) end -- compile the source file -function _compile1(self, sourcefile, objectfile, dependinfo, flags) +function compile(self, sourcefile, objectfile, dependinfo, flags) -- ensure the object directory os.mkdir(path.directory(objectfile)) @@ -179,7 +180,7 @@ function _compile1(self, sourcefile, objectfile, dependinfo, flags) try { function () - local outdata, errdata = os.iorunv(_compargv1(self, sourcefile, objectfile, flags)) + local outdata, errdata = os.iorunv(compargv(self, sourcefile, objectfile, flags)) return (outdata or "") .. (errdata or "") end, catch @@ -215,6 +216,9 @@ function _compile1(self, sourcefile, objectfile, dependinfo, flags) -- print some warnings if warnings and #warnings > 0 and (option.get("verbose") or option.get("warning")) then + if progress.showing_without_scroll() then + print("") + end cprint("${color.warning}%s", table.concat(table.slice(warnings:split('\n'), 1, 8), '\n')) end end @@ -222,23 +226,3 @@ function _compile1(self, sourcefile, objectfile, dependinfo, flags) } end --- make the compile arguments list -function compargv(self, sourcefiles, objectfile, flags) - - -- only support single source file now - assert(type(sourcefiles) ~= "table", "'object:sources' not support!") - - -- for only single source file - return _compargv1(self, sourcefiles, objectfile, flags) -end - --- compile the source file -function compile(self, sourcefiles, objectfile, dependinfo, flags) - - -- only support single source file now - assert(type(sourcefiles) ~= "table", "'object:sources' not support!") - - -- for only single source file - _compile1(self, sourcefiles, objectfile, dependinfo, flags) -end - |
