diff options
Diffstat (limited to 'xmake/tools/go.lua')
| -rwxr-xr-x | xmake/tools/go.lua | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/xmake/tools/go.lua b/xmake/tools/go.lua index 1703862b1..03997d889 100755 --- a/xmake/tools/go.lua +++ b/xmake/tools/go.lua @@ -39,6 +39,12 @@ function init(shellname, kind) -- init arflags _g.arflags = { "grcP" } + + -- init features + _g.features = + { + ["compile:multifiles"] = true + } end -- get the property @@ -107,40 +113,20 @@ function archive(objectfiles, targetfile, flags) end -- make the complie command -function _compcmd1(sourcefile, objectfile, flags) +function compcmd(sourcefiles, objectfile, flags) -- make it - return format("%s tool compile %s -o %s %s", _g.shellname, flags, objectfile, sourcefile) + return format("%s tool compile %s -o %s %s", _g.shellname, flags, objectfile, table.concat(table.wrap(sourcefiles), " ")) end -- complie the source file -function _compile1(sourcefile, objectfile, incdepfile, flags) +function compile(sourcefiles, objectfile, incdepfiles, flags) -- ensure the object directory os.mkdir(path.directory(objectfile)) -- compile it - os.run(_compcmd1(sourcefile, objectfile, flags)) -end - --- make the complie command -function compcmd(sourcefiles, objectfile, flags) - - -- only support single source file now - assert(type(sourcefiles) == "string", "not support") - - -- for only single source file - return _compcmd1(sourcefiles, objectfile, flags) -end - --- complie the source file -function compile(sourcefiles, objectfile, incdepfiles, flags) - - -- only support single source file now - assert(type(sourcefiles) == "string", "not support") - - -- for only single source file - _compile1(sourcefiles, objectfile, incdepfiles, flags) + os.run(compcmd(sourcefiles, objectfile, flags)) end -- check the given flags |
