summaryrefslogtreecommitdiff
path: root/xmake/core/tool/tool.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2016-04-14 09:24:24 +0800
committerruki <[email protected]>2016-04-14 09:24:24 +0800
commit9e736d8b83930330edaee2958b4c66093ca87e37 (patch)
treecefcd89bbc72f1aac02535699f97626560be12ab /xmake/core/tool/tool.lua
parent733935aec221c1bce476e7cfea7b5e64d280f71e (diff)
reimpl compiler and linker
Diffstat (limited to 'xmake/core/tool/tool.lua')
-rw-r--r--xmake/core/tool/tool.lua39
1 files changed, 35 insertions, 4 deletions
diff --git a/xmake/core/tool/tool.lua b/xmake/core/tool/tool.lua
index bca361388..75ef33a22 100644
--- a/xmake/core/tool/tool.lua
+++ b/xmake/core/tool/tool.lua
@@ -100,6 +100,39 @@ function _module:includedir(dir)
return interface.includedir(dir)
end
+-- make the link flag
+function _module:link(lib)
+
+ -- the interface
+ local interface = self._INTERFACE
+ assert(interface)
+
+ -- check
+ if not interface.link then
+ return
+ end
+
+ -- make it
+ return interface.link(lib)
+end
+
+-- TODO wrap dynamic
+-- make the linkdir flag
+function _module:linkdir(dir)
+
+ -- the interface
+ local interface = self._INTERFACE
+ assert(interface)
+
+ -- check
+ if not interface.linkdir then
+ return
+ end
+
+ -- make it
+ return interface.linkdir(dir)
+end
+
-- make the command
function _module:command(srcfile, objfile, flags, logfile)
@@ -174,15 +207,13 @@ function tool._directories(name)
, mm = "compiler"
, mxx = "compiler"
, sc = "compiler"
- , ar = "archiver"
+ , ar = "linker"
, sh = "linker"
, ld = "linker"
- , make = "other"
}
-- get kind sub-directory
- local subdir = kinds[name]
- assert(subdir)
+ local subdir = kinds[name] or ""
-- the directories
return { path.join(path.join(config.directory(), "tools"), subdir)