diff options
Diffstat (limited to 'xmake/core/project/target.lua')
| -rw-r--r-- | xmake/core/project/target.lua | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index 68dfefe3a..4fef8fbd6 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -30,6 +30,7 @@ local table = require("base/table") local option = require("project/option") local config = require("project/config") local linker = require("platform/linker") +local compiler = require("platform/compiler") local platform = require("platform/platform") -- get the filename from the given name and kind @@ -62,9 +63,12 @@ function target.name(self) return self._NAME end --- get the linker with the target kind +-- get the linker function target.linker(self) + -- check + assert(self) + -- init the linker from the given kind local result = linker.init(self:get("kind")) if not result then @@ -76,6 +80,23 @@ function target.linker(self) end +-- get the compiler with the given source file +function target.compiler(self, srcfile) + + -- check + assert(self and srcfile) + + -- init the linker from the given kind + local result, errors = compiler.init(srcfile) + if not result then + os.raise(errors) + end + + -- ok? + return result + +end + -- get the options function target.options(self) |
