summaryrefslogtreecommitdiff
path: root/xmake/core/tool/linker.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-05-18 00:34:51 +0800
committerruki <[email protected]>2022-05-18 00:34:51 +0800
commit91d8197cef25c656b9de6aa95076c2d37f0206c2 (patch)
treeb71f3178159be319b1fd40896b0883868becdea7 /xmake/core/tool/linker.lua
parent053c31a5582c15fea9fc674ec3a14cccd9057b7e (diff)
fix preprocessor flags
Diffstat (limited to 'xmake/core/tool/linker.lua')
-rw-r--r--xmake/core/tool/linker.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/xmake/core/tool/linker.lua b/xmake/core/tool/linker.lua
index 25276bdce..fc6bfc185 100644
--- a/xmake/core/tool/linker.lua
+++ b/xmake/core/tool/linker.lua
@@ -172,6 +172,9 @@ function linker.load(targetkind, sourcekinds, target)
end
instance._NAMEFLAGS = nameflags
+ -- init target (optional)
+ instance._TARGET = target
+
-- init target kind
instance._TARGETKIND = targetkind
@@ -202,6 +205,7 @@ end
-- link the target file
function linker:link(objectfiles, targetfile, opt)
opt = opt or {}
+ opt.target = self:target()
return sandbox.load(self:_tool().link, self:_tool(), table.wrap(objectfiles), self:_targetkind(), targetfile, opt.linkflags or self:linkflags(opt), opt)
end