summaryrefslogtreecommitdiff
path: root/xmake/core/project/target.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2025-10-04 12:11:00 +0800
committerruki <[email protected]>2025-10-04 12:11:00 +0800
commit3f746c3fe8c36431d2fca3ca11cce6c1b8ce116b (patch)
treef78dc7b8b4db27a46d57aa67f346a0ebb445a124 /xmake/core/project/target.lua
parent6fd014681461a19290d66ae5a3b97332baf2f841 (diff)
decrease rule jobs in jobgraph
Diffstat (limited to 'xmake/core/project/target.lua')
-rw-r--r--xmake/core/project/target.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 3839eb01f..4ffa971e6 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -1184,6 +1184,16 @@ function _instance:rule_add(r)
self._ORDERULES = nil
end
+-- enable or disable rule
+function _instance:rule_enable(name, enabled)
+ local ruleinst = self:rule(name)
+ if ruleinst then
+ ruleinst:set("enabled", enabled)
+ else
+ utils.warning("target(%s): rule(%s) not found", self:name(), name)
+ end
+end
+
-- is phony target?
function _instance:is_phony()
local targetkind = self:kind()