diff options
| author | ruki <[email protected]> | 2025-04-06 20:58:25 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-04-08 15:31:57 +0800 |
| commit | 99f68b5c58d822170c84e2b6c0b3f7f974e009be (patch) | |
| tree | c8c56bda3847417b66ca747eab722107847a7f86 /xmake/rules/c++/modules/modules_support/builder.lua | |
| parent | 406b9d08d56eae4893082d75e84f016f4619f66c (diff) | |
remove unused prepare jobs
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/builder.lua')
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/builder.lua | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/xmake/rules/c++/modules/modules_support/builder.lua b/xmake/rules/c++/modules/modules_support/builder.lua index 7d5ebd0c8..2a0977524 100644 --- a/xmake/rules/c++/modules/modules_support/builder.lua +++ b/xmake/rules/c++/modules/modules_support/builder.lua @@ -457,7 +457,10 @@ function build_modules_and_headerunits(target, jobgraph, sourcebatch, modules, o jobgraph:add_orders(build_headerunits_group, build_modules_group) end end - else -- deprecated + elseif jobgraph.runcmds then + build_headerunits_for_batchcmds(target, jobgraph, sourcebatch, modules, opt) + build_modules_for_batchcmds(target, jobgraph, sourcebatch, modules, opt) + elseif jobgraph.newjob then -- deprecated build_modules_for_batchjobs(target, jobgraph, sourcebatch, modules, opt) build_headerunits_for_batchjobs(target, jobgraph, sourcebatch, modules, opt) end @@ -571,3 +574,44 @@ function is_dependencies_changed(target, module) end return requires, changed end + +-- patch sourcebatch +function patch_sourcebatch(target, sourcebatch, opt) + + -- add target deps modules + if target:orderdeps() then + local deps_sourcefiles = dependency_scanner.get_targetdeps_modules(target) + if deps_sourcefiles then + table.join2(sourcebatch.sourcefiles, deps_sourcefiles) + end + end + + -- append std module + local std_modules = compiler_support.get_stdmodules(target) + if std_modules then + table.join2(sourcebatch.sourcefiles, std_modules) + end + + -- extract packages modules dependencies + local package_modules_data = dependency_scanner.get_all_packages_modules(target, opt) + if package_modules_data then + -- append to sourcebatch + for _, package_module_data in table.orderpairs(package_modules_data) do + table.insert(sourcebatch.sourcefiles, package_module_data.file) + target:fileconfig_set(package_module_data.file, {external = package_module_data.external, defines = package_module_data.metadata.defines}) + end + end + + -- patch objectfiles and dependencies + sourcebatch.sourcekind = "cxx" + sourcebatch.objectfiles = {} + sourcebatch.dependfiles = {} + for _, sourcefile in ipairs(sourcebatch.sourcefiles) do + local objectfile = target:objectfile(sourcefile) + table.insert(sourcebatch.objectfiles, objectfile) + + local dependfile = target:dependfile(sourcefile or objectfile) + table.insert(sourcebatch.dependfiles, dependfile) + end +end + |
