summaryrefslogtreecommitdiff
path: root/xmake/core/tool/compiler.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2016-07-09 15:08:28 +0800
committerruki <[email protected]>2016-07-09 15:08:28 +0800
commit9feb387e4e4e6694b2c9ac3de4d517fb4c4ae44a (patch)
tree9581332e5365025b5663c3c48f223a9dfd6f415c /xmake/core/tool/compiler.lua
parent460030d64886772601749b874f06fe536f1d3fd5 (diff)
fix install directory and modify compiler and linker interfaces
Diffstat (limited to 'xmake/core/tool/compiler.lua')
-rw-r--r--xmake/core/tool/compiler.lua21
1 files changed, 17 insertions, 4 deletions
diff --git a/xmake/core/tool/compiler.lua b/xmake/core/tool/compiler.lua
index 7d867a6d2..da4e284fd 100644
--- a/xmake/core/tool/compiler.lua
+++ b/xmake/core/tool/compiler.lua
@@ -308,10 +308,10 @@ function compiler:_addflags_from_compiler(flags, kind)
end
-- get the compiler kind of the source file
-function compiler.kind_of_file(srcfile)
+function compiler.kind_of_file(sourcefile)
-- get the source file type
- local filetype = path.extension(srcfile)
+ local filetype = path.extension(sourcefile)
if not filetype then
return nil
end
@@ -398,8 +398,21 @@ function compiler:get(name)
return self:_tool().get(name)
end
+-- compile the source file
+function compiler:compile(sourcefile, objectfile, target, multitasking)
+
+ -- get flags
+ local flags = nil
+ if target then
+ flags = self:_flags(target)
+ end
+
+ -- compile it
+ return sandbox.load(self:_tool().compile, sourcefile, objectfile, flags or "", multitasking)
+end
+
-- get the compile command
-function compiler:compcmd(srcfile, objfile, target)
+function compiler:compcmd(sourcefile, objectfile, target)
-- get flags
local flags = nil
@@ -408,7 +421,7 @@ function compiler:compcmd(srcfile, objfile, target)
end
-- get it
- return self:_tool().compcmd(srcfile, objfile, flags or "")
+ return self:_tool().compcmd(sourcefile, objectfile, flags or "")
end
-- make the define flag