diff options
| author | ruki <[email protected]> | 2019-03-15 22:42:41 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-03-15 10:16:08 +0800 |
| commit | cc02a8d5a54dd46a63f0da144cfb35b12dcf3263 (patch) | |
| tree | 826251e1187012ba02d8506771f138711d716088 /xmake/core/tool/linker.lua | |
| parent | 9036abe2d5d282bd19c9f6bdd2acee9ac03051fc (diff) | |
add opt.name for has_xxx
Diffstat (limited to 'xmake/core/tool/linker.lua')
| -rw-r--r-- | xmake/core/tool/linker.lua | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/xmake/core/tool/linker.lua b/xmake/core/tool/linker.lua index 6f9d9e6eb..d582d62bb 100644 --- a/xmake/core/tool/linker.lua +++ b/xmake/core/tool/linker.lua @@ -43,13 +43,11 @@ local compiler = require("tool/compiler") -- add flags from the platform function linker:_add_flags_from_platform(flags, targetkind) - -- add flags - local toolkind = self:kind() - local toolname = self:name() - for _, flagkind in ipairs(self:_flagkinds()) do - - -- attempt to add special lanugage flags first for target kind, .e.g gc-ldflags, dc-arflags - if targetkind then + -- attempt to add special lanugage flags first for target kind, .e.g binary.gc-ldflags, static.dc-arflags + if targetkind then + local toolkind = self:kind() + local toolname = self:name() + for _, flagkind in ipairs(self:_flagkinds()) do local toolflags = platform.get(targetkind .. '.' .. toolname .. '.' .. toolkind .. 'flags') or platform.get(targetkind .. '.' .. toolname .. '.' .. flagkind) table.join2(flags, toolflags or platform.get(targetkind .. '.' .. toolkind .. 'flags') or platform.get(targetkind .. '.' .. flagkind)) end @@ -277,9 +275,7 @@ function linker:linkflags(opt) end -- add flags from the platform - if target then - self:_add_flags_from_platform(flags, targetkind) - end + self:_add_flags_from_platform(flags, targetkind) -- add flags from the compiler if target then |
