diff options
| author | ruki <[email protected]> | 2023-04-27 00:24:19 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-04-27 00:24:19 +0800 |
| commit | 0086252ba8c687e528b8172c34c874af41dc21f7 (patch) | |
| tree | 71d1dc6c087c08a8991b079716cf128e9e7ef8eb /xmake/plugins/project/utils/target_cmds.lua | |
| parent | 9299a0eaa3629ee2e9b29cb8ba8bbd8bf26a80a5 (diff) | |
improve cmakelists
Diffstat (limited to 'xmake/plugins/project/utils/target_cmds.lua')
| -rw-r--r-- | xmake/plugins/project/utils/target_cmds.lua | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/xmake/plugins/project/utils/target_cmds.lua b/xmake/plugins/project/utils/target_cmds.lua index c71b23f96..e732f07d7 100644 --- a/xmake/plugins/project/utils/target_cmds.lua +++ b/xmake/plugins/project/utils/target_cmds.lua @@ -89,36 +89,17 @@ function get_target_buildcmd_files(target, cmds, sourcebatch, suffix) end -- get target buildcmd commands of source group -function get_target_buildcmd_sourcegroups(target, cmds, groups, suffix) - for idx, group in irpairs(groups) do +function get_target_buildcmd_sourcegroups(target, cmds, sourcegroups, suffix) + for idx, group in irpairs(sourcegroups) do for _, item in pairs(group) do -- buildcmd scripts are always in rule, so we need ignore target item (item.target). local sourcebatch = item.sourcebatch if item.rule then if not _sourcebatch_is_built(sourcebatch) then - get_target_buildcmd_files(target, cmds_before, sourcebatch, suffix) + get_target_buildcmd_files(target, cmds, sourcebatch, suffix) end end end end end --- get target custom commands -function _get_target_cmds(target) - - -- build sourcebatch groups first - local groups = rule_groups.build_sourcebatch_groups(target, target:sourcebatches()) - - -- add before commands - -- we use irpairs(groups), because the last group that should be given the highest priority. - local cmds_before = {} - get_target_buildcmd(target, cmds_before, "before") - get_target_buildcmd_sourcegroups(target, cmds_before, groups, "before") - _add_target_cmds_for_batchcmds(target, "before", cmds_before) - - -- add after commands - local cmds_after = {} - get_target_buildcmd(target, cmds_after, "after") - get_target_buildcmd_sourcegroups(target, cmds_after, groups, "after") - _add_target_cmds_for_batchcmds(target, "after", cmds_after) -end |
