summaryrefslogtreecommitdiff
path: root/xmake/core/tool/compiler.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2018-11-12 22:38:43 +0800
committerruki <[email protected]>2018-11-12 09:52:19 +0800
commit377840c51da27c07f9d94caf458f99eb197798e3 (patch)
tree3561bdbbc9b7a82b06cc68494e3a9f0f52bd5f2d /xmake/core/tool/compiler.lua
parentf372a5c5cf20e9a7deaa99cdb9d2c14b5aec7755 (diff)
improve platform
Diffstat (limited to 'xmake/core/tool/compiler.lua')
-rw-r--r--xmake/core/tool/compiler.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/xmake/core/tool/compiler.lua b/xmake/core/tool/compiler.lua
index 34334bf95..99f965a0a 100644
--- a/xmake/core/tool/compiler.lua
+++ b/xmake/core/tool/compiler.lua
@@ -48,15 +48,17 @@ end
function compiler:_addflags_from_platform(flags, targetkind)
-- add flags
- local toolkind = self:kind()
+ local toolname = self:name()
for _, flagkind in ipairs(self:_flagkinds()) do
- -- add flags for platform
- table.join2(flags, platform.get(flagkind))
+ -- add flags for platform, e.g. gcc.cxflags or cxflags
+ local toolflags = platform.get(toolname .. '.' .. flagkind)
+ table.join2(flags, toolflags or platform.get(flagkind))
- -- add flags for platform and the given taget kind
- if targetkind ~= nil and platform.get(targetkind) ~= nil then
- table.join2(flags, platform.get(targetkind)[flagkind])
+ -- add flags for platform with the given target kind, e.g. binary.gcc.cxflags or binary.cxflags
+ if targetkind then
+ local toolflags = platform.get(targetkind .. '.' .. toolname .. '.' .. flagkind)
+ table.join2(flags, toolflags or platform.get(targetkind .. '.' .. flagkind))
end
end
end