diff options
| author | ruki <[email protected]> | 2017-02-14 09:00:26 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-02-14 09:00:26 +0800 |
| commit | 5e23aa6f9344b21dee98ad3fad9182808d690485 (patch) | |
| tree | 2592b6b087dce76b6447d4de2a5a1446b6c98169 /xmake/tools/swiftc.lua | |
| parent | f7eaf51c4cad7d94989e130de2172df2cbc74193 (diff) | |
modify interface for compiling multiple source files
Diffstat (limited to 'xmake/tools/swiftc.lua')
| -rw-r--r-- | xmake/tools/swiftc.lua | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/xmake/tools/swiftc.lua b/xmake/tools/swiftc.lua index 266c64cf4..f5dec36aa 100644 --- a/xmake/tools/swiftc.lua +++ b/xmake/tools/swiftc.lua @@ -173,7 +173,7 @@ function nf_framework(framework) end -- make the compile command -function compcmd(sourcefile, objectfile, flags) +function _compcmd1(sourcefile, objectfile, flags) -- get ccache local ccache = nil @@ -192,13 +192,33 @@ function compcmd(sourcefile, objectfile, flags) 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)) -- compile it - os.run(compcmd(sourcefile, objectfile, flags)) + 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) end -- check the given flags |
