diff options
| author | ruki <[email protected]> | 2024-02-19 22:56:34 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-02-19 22:56:34 +0800 |
| commit | 42a99c91fca4e56d5166751cd7667886e1a6801f (patch) | |
| tree | e50de63432b0b68837f538e0b713932f051535e1 /xmake/plugins/project/utils | |
| parent | f4a9a9e3fa36f3f0cf1e655c58bf3fa4d546348b (diff) | |
ignore c++ modules rules
Diffstat (limited to 'xmake/plugins/project/utils')
| -rw-r--r-- | xmake/plugins/project/utils/target_cmds.lua | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/xmake/plugins/project/utils/target_cmds.lua b/xmake/plugins/project/utils/target_cmds.lua index 92d1bee47..0b98a4ed7 100644 --- a/xmake/plugins/project/utils/target_cmds.lua +++ b/xmake/plugins/project/utils/target_cmds.lua @@ -42,14 +42,17 @@ end function get_target_buildcmd(target, cmds, opt) opt = opt or {} local suffix = opt.suffix + local ignored_rules = hashset.from(opt.ignored_rules or {}) for _, ruleinst in ipairs(target:orderules()) do - local scriptname = "buildcmd" .. (suffix and ("_" .. suffix) or "") - local script = ruleinst:script(scriptname) - if script then - local batchcmds_ = batchcmds.new({target = target}) - script(target, batchcmds_, {}) - if not batchcmds_:empty() then - table.join2(cmds, batchcmds_:cmds()) + if not ignored_rules:has(ruleinst:name()) then + local scriptname = "buildcmd" .. (suffix and ("_" .. suffix) or "") + local script = ruleinst:script(scriptname) + if script then + local batchcmds_ = batchcmds.new({target = target}) + script(target, batchcmds_, {}) + if not batchcmds_:empty() then + table.join2(cmds, batchcmds_:cmds()) + end end end end @@ -62,6 +65,10 @@ function get_target_buildcmd_files(target, cmds, sourcebatch, opt) -- get rule local rulename = assert(sourcebatch.rulename, "unknown rule for sourcebatch!") local ruleinst = assert(target:rule(rulename) or project.rule(rulename) or rule.rule(rulename), "unknown rule: %s", rulename) + local ignored_rules = hashset.from(opt.ignored_rules or {}) + if ignored_rules:has(ruleinst:name()) then + return + end -- generate commands for xx_buildcmd_files local suffix = opt.suffix |
