diff options
| author | ruki <[email protected]> | 2016-07-09 15:08:28 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2016-07-09 15:08:28 +0800 |
| commit | 9feb387e4e4e6694b2c9ac3de4d517fb4c4ae44a (patch) | |
| tree | 9581332e5365025b5663c3c48f223a9dfd6f415c /xmake/actions/build/builder.lua | |
| parent | 460030d64886772601749b874f06fe536f1d3fd5 (diff) | |
fix install directory and modify compiler and linker interfaces
Diffstat (limited to 'xmake/actions/build/builder.lua')
| -rwxr-xr-x | xmake/actions/build/builder.lua | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/xmake/actions/build/builder.lua b/xmake/actions/build/builder.lua index 8264e4476..b10e76bbe 100755 --- a/xmake/actions/build/builder.lua +++ b/xmake/actions/build/builder.lua @@ -91,31 +91,30 @@ function _build_object(target, index) return _build_object_for_static(target, sourcefile, objectfile, percent) end - -- make command - local command = compiler.compcmd(sourcefile, objectfile, target) - -- uses ccache local ccache = nil if config.get("ccache") then ccache = tool.shellname("ccache") end - if ccache then - command = ccache:append(command, " ") - end -- trace print("[%02d%%]: %scompiling.$(mode) %s", percent, ifelse(ccache, "ccache ", ""), sourcefile) -- trace verbose info if option.get("verbose") then + + -- make command + local command = compiler.compcmd(sourcefile, objectfile, target) + if ccache then + command = ccache:append(command, " ") + end + + -- trace print(command) end - -- create directory if not exists - os.mkdir(path.directory(objectfile)) - - -- run cmd with coroutine - os.corun(command) + -- complie it and enable multitasking + compiler.compile(sourcefile, objectfile, target, true) end -- make objects for the given target @@ -205,23 +204,19 @@ function _build_target(target) end end - -- make the command for linking target - local targetfile = target:targetfile() - local command = linker.linkcmd(objectfiles, targetfile, target) + -- the target file + local targetfile = target:targetfile() -- trace print("[%02d%%]: linking.$(mode) %s", _g.targetindex * 100 / _g.targetcount, path.filename(targetfile)) -- trace verbose info if option.get("verbose") then - print(command) + print(linker.linkcmd(objectfiles, targetfile, target)) end - -- create directory if not exists - os.mkdir(path.directory(targetfile)) - - -- run command - os.run(command) + -- link it + linker.link(objectfiles, targetfile, target) end -- make the given target |
