From 37d53d0646fd32ebc747dc22be0cc1390887bc3a Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 25 Aug 2018 00:34:01 +0800 Subject: add set_enable api --- xmake/core/project/project.lua | 5 ++++- xmake/core/project/target.lua | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'xmake') diff --git a/xmake/core/project/project.lua b/xmake/core/project/project.lua index 418a35086..b60e5f79b 100644 --- a/xmake/core/project/project.lua +++ b/xmake/core/project/project.lua @@ -355,7 +355,10 @@ function project._load_targets() -- make targets local targets = {} for targetname, targetinfo in pairs(results) do - targets[targetname] = target.new(targetname, targetinfo, project) + local t = target.new(targetname, targetinfo, project) + if t and (t:get("enabled") == nil or t:get("enabled") == true) then + targets[targetname] = t + end end -- load and attach target deps and rules diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index 2c2b20ae4..1d8a8fb24 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -53,6 +53,7 @@ function target.apis() "target.set_kind" , "target.set_strip" , "target.set_rules" + , "target.set_enabled" , "target.set_default" , "target.set_options" , "target.set_symbols" -- cgit v1.3.1