summaryrefslogtreecommitdiff
path: root/xmake/core/tool/builder.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/builder.lua
parent03b2656fb77fb3339e43bf8871398b0e2f052a80 (diff)
improve linker and compiler for package
Diffstat (limited to 'xmake/core/tool/builder.lua')
-rw-r--r--xmake/core/tool/builder.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/xmake/core/tool/builder.lua b/xmake/core/tool/builder.lua
index 08a6080c7..9b59de413 100644
--- a/xmake/core/tool/builder.lua
+++ b/xmake/core/tool/builder.lua
@@ -181,6 +181,12 @@ function builder:_add_flags_from_target(flags, target)
return
end
+ -- only for target and option
+ local target_type = target:type()
+ if target_type ~= "target" and target_type ~= "option" then
+ return
+ end
+
-- init cache
self._TARGETFLAGS = self._TARGETFLAGS or {}
local cache = self._TARGETFLAGS
@@ -195,7 +201,7 @@ function builder:_add_flags_from_target(flags, target)
self:_add_flags_from_language(targetflags, target)
-- add flags for the target
- if target:type() == "target" then
+ if target_type == "target" then
-- add flags from options
self:_add_flags_from_targetopts(targetflags, target)