summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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