summaryrefslogtreecommitdiff
path: root/xmake/core/tool/linker.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/linker.lua
parentf372a5c5cf20e9a7deaa99cdb9d2c14b5aec7755 (diff)
improve platform
Diffstat (limited to 'xmake/core/tool/linker.lua')
-rw-r--r--xmake/core/tool/linker.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/xmake/core/tool/linker.lua b/xmake/core/tool/linker.lua
index 2cfc20fdf..363e7ad30 100644
--- a/xmake/core/tool/linker.lua
+++ b/xmake/core/tool/linker.lua
@@ -45,15 +45,17 @@ function linker:_addflags_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, .e.g gc-ldflags, dc-arflags
- table.join2(flags, platform.get(toolkind .. 'flags') or platform.get(flagkind))
+ -- attempt to add special lanugage flags first, e.g. go.gc-ldflags or gcc.ldflags or gc-ldflags or ldflags
+ local toolflags = platform.get(toolname .. '.' .. toolkind .. 'flags') or platform.get(toolname .. '.' .. flagkind)
+ table.join2(flags, toolflags or platform.get(toolkind .. 'flags') or platform.get(flagkind))
-- attempt to add special lanugage flags first for target kind, .e.g gc-ldflags, dc-arflags
if targetkind then
- local targetflags = platform.get(targetkind) or {}
- table.join2(flags, targetflags[toolkind .. 'flags'] or targetflags[flagkind])
+ 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
end
end