From a3f09cd2c9ef5e73f6f49cb4f335b9d6361ace4f Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 2 Sep 2023 00:32:56 +0800 Subject: fix target not found --- xmake/actions/build/build.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/xmake/actions/build/build.lua b/xmake/actions/build/build.lua index 4e095a27d..a2972950d 100644 --- a/xmake/actions/build/build.lua +++ b/xmake/actions/build/build.lua @@ -235,12 +235,14 @@ function get_batchjobs(targetname, group_pattern) local targets_root = {} if targetname then local target = project.target(targetname) - table.insert(targets_root, target) - if option.get("rebuild") then - target:data_set("rebuilt", true) - if not option.get("shallow") then - for _, dep in ipairs(target:orderdeps()) do - dep:data_set("rebuilt", true) + if target then + table.insert(targets_root, target) + if option.get("rebuild") then + target:data_set("rebuilt", true) + if not option.get("shallow") then + for _, dep in ipairs(target:orderdeps()) do + dep:data_set("rebuilt", true) + end end end end -- cgit v1.3.1