summaryrefslogtreecommitdiff
path: root/xmake/tools/rustc.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-06-21 08:41:22 +0800
committerruki <[email protected]>2017-06-21 08:41:22 +0800
commit45a54659f7449ead7ed073f9c0cbbe1da9fcdc06 (patch)
treea09be69c75dce6435d7584ad467aeb51e3c8d37a /xmake/tools/rustc.lua
parentace13f7594d5dbddd771cfe0a4004bbcb506b11c (diff)
rename shellname to program
Diffstat (limited to 'xmake/tools/rustc.lua')
-rw-r--r--xmake/tools/rustc.lua11
1 files changed, 5 insertions, 6 deletions
diff --git a/xmake/tools/rustc.lua b/xmake/tools/rustc.lua
index 44e117d3f..df261545a 100644
--- a/xmake/tools/rustc.lua
+++ b/xmake/tools/rustc.lua
@@ -23,16 +23,15 @@
--
-- imports
-import("core.tool.tool")
import("core.base.option")
import("core.project.config")
import("core.project.project")
-- init it
-function init(shellname, kind)
+function init(program, kind)
-- save the shell name
- _g.shellname = shellname or "rustc"
+ _g.program = program or "rustc"
-- save the kind
_g.kind = kind
@@ -110,7 +109,7 @@ end
function buildcmd(sourcefiles, targetkind, targetfile, flags)
-- make it
- return format("%s %s -o %s %s", _g.shellname, flags, targetfile, table.concat(sourcefiles, " "))
+ return format("%s %s -o %s %s", _g.program, flags, targetfile, table.concat(sourcefiles, " "))
end
-- build the target file
@@ -127,7 +126,7 @@ end
function compcmd(sourcefiles, objectfile, flags)
-- make it
- return format("%s --emit obj %s -o %s %s", _g.shellname, flags, objectfile, table.concat(table.wrap(sourcefiles), " "))
+ return format("%s --emit obj %s -o %s %s", _g.program, flags, objectfile, table.concat(table.wrap(sourcefiles), " "))
end
-- complie the source file
@@ -151,7 +150,7 @@ function check(flags)
io.writefile(sourcefile, "fn main() {\n}")
-- check it
- os.run("%s --emit obj %s -o %s %s", _g.shellname, ifelse(flags, flags, ""), objectfile, sourcefile)
+ os.run("%s --emit obj %s -o %s %s", _g.program, ifelse(flags, flags, ""), objectfile, sourcefile)
-- remove files
os.rm(objectfile)