From 017aea4a93318a09e0137190ae72302b8257d3b1 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 25 Feb 2021 23:56:20 +0800 Subject: improve builder and languages --- xmake/core/tool/builder.lua | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'xmake/core/tool/builder.lua') diff --git a/xmake/core/tool/builder.lua b/xmake/core/tool/builder.lua index 04349dbf2..2e503022e 100644 --- a/xmake/core/tool/builder.lua +++ b/xmake/core/tool/builder.lua @@ -275,28 +275,19 @@ function builder:_add_flags_from_language(flags, target, getters) end end , target = function (name) - - -- only for target local results = {} if target:type() == "target" then - -- get flagvalues (public or interface) of all dependent targets (contain packages/options) - table.join2(results, target:get_from_deps(name, {interface = true})) - -- get flagvalues of target with given flagname table.join2(results, target:get(name)) - end - return results - end - , option = function (name) - -- is target? get flagvalues of the attached options and packages - local results = {} - if target:type() == "target" then + -- get flagvalues of the attached options and packages table.join2(results, target:get_from_opts(name)) table.join2(results, target:get_from_pkgs(name)) - -- is option? get flagvalues of option with given flagname + -- get flagvalues (public or interface) of all dependent targets (contain packages/options) + table.join2(results, target:get_from_deps(name, {interface = true})) + elseif target:type() == "option" then table.join2(results, target:get(name)) end -- cgit v1.3.1