diff options
| author | ruki <[email protected]> | 2017-03-14 16:36:17 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-03-14 16:36:17 +0800 |
| commit | 1b6a8e30929fc676865aca1abb4d71aad222b94b (patch) | |
| tree | d0662cc6162e7c66628627c688c5a3eddc4b3c80 | |
| parent | e744c374ae725356997f7228a27a0a616ed464c6 (diff) | |
fix cxflags bug
| -rw-r--r-- | xmake/core/tool/builder.lua | 11 | ||||
| -rw-r--r-- | xmake/core/tool/compiler.lua | 10 | ||||
| -rw-r--r-- | xmake/core/tool/linker.lua | 11 |
3 files changed, 21 insertions, 11 deletions
diff --git a/xmake/core/tool/builder.lua b/xmake/core/tool/builder.lua index de562593b..aa212ead6 100644 --- a/xmake/core/tool/builder.lua +++ b/xmake/core/tool/builder.lua @@ -152,17 +152,6 @@ function builder:_addflags_from_target(flags, target) end end --- add flags from the platform -function builder:_addflags_from_platform(flags) - - -- add flags - local toolkind = self:get("kind") - for _, flagkind in ipairs(self:_flagkinds()) do - -- attempt to add special lanugage flags first, .e.g gc-ldflags, dc-arflags - table.join2(flags, platform.get(toolkind .. 'flags') or platform.get(flagkind)) - end -end - -- add flags (named) from the language function builder:_addflags_from_language(flags, target) diff --git a/xmake/core/tool/compiler.lua b/xmake/core/tool/compiler.lua index 98c258d6b..c1bc3221e 100644 --- a/xmake/core/tool/compiler.lua +++ b/xmake/core/tool/compiler.lua @@ -46,6 +46,16 @@ function compiler:_language() return self._LANGUAGE end +-- add flags from the platform +function compiler:_addflags_from_platform(flags) + + -- add flags + local toolkind = self:get("kind") + for _, flagkind in ipairs(self:_flagkinds()) do + table.join2(flags, platform.get(flagkind)) + end +end + -- add flags from the compiler function compiler:_addflags_from_compiler(flags, kind) diff --git a/xmake/core/tool/linker.lua b/xmake/core/tool/linker.lua index 96f54b863..c1485391c 100644 --- a/xmake/core/tool/linker.lua +++ b/xmake/core/tool/linker.lua @@ -40,6 +40,17 @@ local tool = require("tool/tool") local builder = require("tool/builder") local compiler = require("tool/compiler") +-- add flags from the platform +function linker:_addflags_from_platform(flags) + + -- add flags + local toolkind = self:get("kind") + for _, flagkind in ipairs(self:_flagkinds()) do + -- attempt to add special lanugage flags first, .e.g gc-ldflags, dc-arflags + table.join2(flags, platform.get(toolkind .. 'flags') or platform.get(flagkind)) + end +end + -- add flags from the compiler function linker:_addflags_from_compiler(flags, sourcekinds) |
