summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-09-01 22:34:40 +0800
committerruki <[email protected]>2023-09-01 22:34:40 +0800
commitdcc5abf105e7df9d47e37e18191bef2503edb085 (patch)
tree8230bc3f1b7c156f4b7c9a0f6baaf5448862f873
parent12f2bed0df8299d3765761dc9a7567e8f7b18fa5 (diff)
add --shallow
-rw-r--r--xmake/actions/build/build.lua5
-rw-r--r--xmake/actions/build/xmake.lua1
2 files changed, 6 insertions, 0 deletions
diff --git a/xmake/actions/build/build.lua b/xmake/actions/build/build.lua
index d37386659..4e095a27d 100644
--- a/xmake/actions/build/build.lua
+++ b/xmake/actions/build/build.lua
@@ -238,6 +238,11 @@ function get_batchjobs(targetname, group_pattern)
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
else
local depset = hashset.new()
diff --git a/xmake/actions/build/xmake.lua b/xmake/actions/build/xmake.lua
index 8c039bdca..6f54fb69e 100644
--- a/xmake/actions/build/xmake.lua
+++ b/xmake/actions/build/xmake.lua
@@ -30,6 +30,7 @@ task("build")
{'b', "build", "k", nil , "Build target. This is default building mode and optional." }
, {'r', "rebuild", "k", nil , "Rebuild the target." }
, {'a', "all", "k", nil , "Build all targets." }
+ , {nil, "shallow", "k", nil , "Only re-build the given targets without dependencies." }
, {'g', "group", "kv", nil , "Build all targets of the given group. It support path pattern matching.",
"e.g.",
" xmake -g test",