summaryrefslogtreecommitdiff
path: root/xmake/tools/go.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-02-14 10:53:05 +0800
committerruki <[email protected]>2017-02-14 10:53:13 +0800
commit7f135386a31972e4f4e486ae5854115b2e1af5a2 (patch)
tree6a8b9329f3209c7cc72cb7aaac0a581480eb1f93 /xmake/tools/go.lua
parent5e23aa6f9344b21dee98ad3fad9182808d690485 (diff)
select feature for compiler
Diffstat (limited to 'xmake/tools/go.lua')
-rwxr-xr-xxmake/tools/go.lua34
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