summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/go.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-07-13 09:51:24 +0800
committerruki <[email protected]>2017-07-13 09:51:41 +0800
commitb9e5a411e38224db1f71a39cad57cc54dc13fee6 (patch)
tree916f94e87922de4b7ec2168245e3c1fd8763a8e6 /xmake/modules/core/tools/go.lua
parentb72d2cd32d1919170eb621dd6c0074c975eb67e1 (diff)
modify all cmd to argv for core.tools
Diffstat (limited to 'xmake/modules/core/tools/go.lua')
-rw-r--r--xmake/modules/core/tools/go.lua18
1 files changed, 9 insertions, 9 deletions
diff --git a/xmake/modules/core/tools/go.lua b/xmake/modules/core/tools/go.lua
index 46b434e58..cb597652f 100644
--- a/xmake/modules/core/tools/go.lua
+++ b/xmake/modules/core/tools/go.lua
@@ -104,14 +104,14 @@ function nf_linkdir(self, dir)
return {"-L", dir}
end
--- make the link command
-function linkcmd(self, objectfiles, targetkind, targetfile, flags)
+-- make the link arguments list
+function linkargv(self, objectfiles, targetkind, targetfile, flags)
-- make it
if targetkind == "static" then
- return format("%s tool pack %s %s %s", self:program(), flags, targetfile, objectfiles)
+ return self:program(), table.join("tool", "pack", flags, targetfile, objectfiles)
else
- return format("%s tool link %s -o %s %s", self:program(), flags, targetfile, objectfiles)
+ return self:program(), table.join("tool", "link", flags, "-o", targetfile, objectfiles)
end
end
@@ -122,12 +122,12 @@ function link(self, objectfiles, targetkind, targetfile, flags)
os.mkdir(path.directory(targetfile))
-- link it
- os.run(linkcmd(self, objectfiles, targetkind, targetfile, flags))
+ os.runv(linkargv(self, objectfiles, targetkind, targetfile, flags))
end
--- make the complie command
-function compcmd(self, sourcefiles, objectfile, flags)
- return format("%s tool compile %s -o %s %s", self:program(), flags, objectfile, table.concat(table.wrap(sourcefiles), " "))
+-- make the complie arguments list
+function compargv(self, sourcefiles, objectfile, flags)
+ return self:program(), table.join("tool", "compile", flags, "-o", objectfile, sourcefiles)
end
-- complie the source file
@@ -137,6 +137,6 @@ function compile(self, sourcefiles, objectfile, incdepfile, flags)
os.mkdir(path.directory(objectfile))
-- compile it
- os.run(compcmd(self, sourcefiles, objectfile, flags))
+ os.runv(compargv(self, sourcefiles, objectfile, flags))
end