summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-09-02 00:32:56 +0800
committerruki <[email protected]>2023-09-02 00:32:56 +0800
commita3f09cd2c9ef5e73f6f49cb4f335b9d6361ace4f (patch)
tree2cea4366d08064f1c28636f604ca7f1a8f11c17c
parentb4633caab60039b8410acf07f18983ac09679306 (diff)
fix target not found
-rw-r--r--xmake/actions/build/build.lua14
1 files 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