summaryrefslogtreecommitdiff
path: root/xmake/core/tool/linker.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-03-21 12:55:10 +0800
committerruki <[email protected]>2021-03-21 12:55:10 +0800
commitefa052bcecd4203dfce0fda26a297f3ce45ed47d (patch)
tree6c647dba446e5dcbc1a1bba06991813215c1ac1b /xmake/core/tool/linker.lua
parent03b2656fb77fb3339e43bf8871398b0e2f052a80 (diff)
improve linker and compiler for package
Diffstat (limited to 'xmake/core/tool/linker.lua')
-rw-r--r--xmake/core/tool/linker.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/xmake/core/tool/linker.lua b/xmake/core/tool/linker.lua
index 65eabce46..cc67088a2 100644
--- a/xmake/core/tool/linker.lua
+++ b/xmake/core/tool/linker.lua
@@ -86,7 +86,7 @@ function linker._load_tool(targetkind, sourcekinds, target)
-- get program from target
local program, toolname, toolchain_info
- if target and target:type() == "target" then
+ if target and target.tool then
program, toolname, toolchain_info = target:tool(_linkerinfo.linkerkind)
end
@@ -185,7 +185,7 @@ function linker.load(targetkind, sourcekinds, target)
-- add special lanugage flags first, e.g. go.gcldflags or gcc.ldflags or gcldflags or ldflags
local toolkind = linkertool:kind()
local toolname = linkertool:name()
- if target and target:type() == "target" then
+ if target and target.toolconfig then
for _, flagkind in ipairs(instance:_flagkinds()) do
linkertool:add(toolkind .. 'flags', target:toolconfig(toolname .. '.' .. toolkind .. 'flags') or target:toolconfig(toolkind .. 'flags'))
linkertool:add(flagkind, target:toolconfig(toolname .. '.' .. flagkind) or target:toolconfig(flagkind))