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/compiler.lua | |
| parent | 9036abe2d5d282bd19c9f6bdd2acee9ac03051fc (diff) | |
add opt.name for has_xxx
Diffstat (limited to 'xmake/core/tool/compiler.lua')
| -rw-r--r-- | xmake/core/tool/compiler.lua | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/xmake/core/tool/compiler.lua b/xmake/core/tool/compiler.lua index a3715379f..01b9bf659 100644 --- a/xmake/core/tool/compiler.lua +++ b/xmake/core/tool/compiler.lua @@ -47,12 +47,10 @@ end -- add flags from the platform function compiler:_add_flags_from_platform(flags, targetkind) - -- add flags - local toolname = self:name() - for _, flagkind in ipairs(self:_flagkinds()) do - - -- add flags for platform with the given target kind, e.g. binary.gcc.cxflags or binary.cxflags - if targetkind then + -- add flags for platform with the given target kind, e.g. binary.gcc.cxflags or binary.cxflags + if targetkind then + local toolname = self:name() + for _, flagkind in ipairs(self:_flagkinds()) do local toolflags = platform.get(targetkind .. '.' .. toolname .. '.' .. flagkind) table.join2(flags, toolflags or platform.get(targetkind .. '.' .. flagkind)) end @@ -306,9 +304,7 @@ function compiler:compflags(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 self:_add_flags_from_compiler(flags, targetkind) |
