summaryrefslogtreecommitdiff
path: root/xmake/tools/cl.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2017-02-14 09:00:26 +0800
committerruki <[email protected]>2017-02-14 09:00:26 +0800
commit5e23aa6f9344b21dee98ad3fad9182808d690485 (patch)
tree2592b6b087dce76b6447d4de2a5a1446b6c98169 /xmake/tools/cl.lua
parentf7eaf51c4cad7d94989e130de2172df2cbc74193 (diff)
modify interface for compiling multiple source files
Diffstat (limited to 'xmake/tools/cl.lua')
-rwxr-xr-xxmake/tools/cl.lua26
1 files changed, 23 insertions, 3 deletions
diff --git a/xmake/tools/cl.lua b/xmake/tools/cl.lua
index 963bf3447..12016b421 100755
--- a/xmake/tools/cl.lua
+++ b/xmake/tools/cl.lua
@@ -218,14 +218,14 @@ function nf_includedir(dir)
end
-- make the complie command
-function compcmd(sourcefile, objectfile, flags)
+function _compcmd1(sourcefile, objectfile, flags)
-- make it
return format("%s -c %s -Fo%s %s", _g.shellname, flags, objectfile, sourcefile)
end
-- complie the source file
-function compile(sourcefile, objectfile, incdepfile, flags)
+function _compile1(sourcefile, objectfile, incdepfile, flags)
-- ensure the object directory
os.mkdir(path.directory(objectfile))
@@ -239,7 +239,7 @@ function compile(sourcefile, objectfile, incdepfile, flags)
local outdata = try
{
function ()
- return os.iorun(compcmd(sourcefile, objectfile, flags))
+ return os.iorun(_compcmd1(sourcefile, objectfile, flags))
end,
catch
@@ -285,6 +285,26 @@ function compile(sourcefile, objectfile, incdepfile, flags)
end
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)
+end
+
-- check the given flags
function check(flags)