From efa052bcecd4203dfce0fda26a297f3ce45ed47d Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 21 Mar 2021 12:55:10 +0800 Subject: improve linker and compiler for package --- xmake/core/tool/builder.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'xmake/core/tool/builder.lua') 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) -- cgit v1.3.1