summaryrefslogtreecommitdiff
path: root/xmake/actions/build/build.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-09-01 00:39:52 +0800
committerruki <[email protected]>2023-09-01 00:39:52 +0800
commit6dc3f73929a7dde224d77bbcd5db54be22958cda (patch)
treece48016aca43fe9d4830a8963f74820957a7dced /xmake/actions/build/build.lua
parent515dbd9e94793b0bd126a19ecc8f482752897ed9 (diff)
improve to rebuild target #4154
Diffstat (limited to 'xmake/actions/build/build.lua')
-rw-r--r--xmake/actions/build/build.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/xmake/actions/build/build.lua b/xmake/actions/build/build.lua
index 69b1de5da..227786a9f 100644
--- a/xmake/actions/build/build.lua
+++ b/xmake/actions/build/build.lua
@@ -178,7 +178,7 @@ function _add_batchjobs_for_target(batchjobs, rootjob, target)
end
-- clean target if rebuild
- if option.get("rebuild") and not option.get("dry-run") then
+ if target:is_rebuilt() and not option.get("dry-run") then
_clean_target(target)
end
@@ -234,7 +234,11 @@ function get_batchjobs(targetname, group_pattern)
-- get root targets
local targets_root = {}
if targetname then
- table.insert(targets_root, project.target(targetname))
+ local target = project.target(targetname)
+ table.insert(targets_root, target)
+ if option.get("rebuild") then
+ target:data_set("rebuilt", true)
+ end
else
local depset = hashset.new()
local targets = {}
@@ -253,6 +257,9 @@ function get_batchjobs(targetname, group_pattern)
if not depset:has(target:name()) then
table.insert(targets_root, target)
end
+ if option.get("rebuild") then
+ target:data_set("rebuilt", true)
+ end
end
end