diff options
| author | Arthur LAURENT <[email protected]> | 2024-07-24 03:55:17 +0200 |
|---|---|---|
| committer | Arthur LAURENT <[email protected]> | 2024-07-24 04:01:31 +0200 |
| commit | 4f359b270da52a3f2a9c6a6e30a550342896f21e (patch) | |
| tree | d4263116283791a584766d540973cd463c117c23 | |
| parent | 14f95cbe61ff9c652810913f54e06bcd49465e58 (diff) | |
improve warning when modules get culled
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/dependency_scanner.lua | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/xmake/rules/c++/modules/modules_support/dependency_scanner.lua b/xmake/rules/c++/modules/modules_support/dependency_scanner.lua index c2dce1203..c8da6793a 100644 --- a/xmake/rules/c++/modules/modules_support/dependency_scanner.lua +++ b/xmake/rules/c++/modules/modules_support/dependency_scanner.lua @@ -435,6 +435,7 @@ function sort_modules_by_dependencies(target, objectfiles, modules, opt) objectfiles_sorted_set:insert(objectfile) end end + local culleds for _, objectfile in ipairs(objectfiles_sorted) do local name, provide, cppfile = compiler_support.get_provided_module(modules[objectfile]) local fileconfig = target:fileconfig(cppfile) @@ -472,11 +473,26 @@ function sort_modules_by_dependencies(target, objectfiles, modules, opt) else objectfiles_sorted_set:remove(objectfile) if name ~= "std" and name ~= "std.compat" then - wprint("%s has been culled because it's not consumed by its target (%s) nor flagged as a public module (add_files(\"%s\", {public = true}))", name, target:name(), path.filename(cppfile)) + culleds = culleds or {} + culleds[target:name()] = culleds[target:name()] or {} + table.insert(culleds[target:name()], format("%s -> %s", name, cppfile)) end end end + if culleds then + if option.get("verbose") then + local culled_strs = {} + for target_name, m in pairs(culleds) do + table.insert(culled_strs, format("%s:\n %s", target_name, table.concat(m, "\n "))) + end + wprint("some modules have got culled, because it is not consumed by its target nor flagged as a public module with add_files(\"xxx.mpp\", {public = true})\n %s", + table.concat(culled_strs, "\n ")) + else + wprint("some modules have got culled, use verbose (-v) mode to more informations") + end + end + return build_objectfiles, link_objectfiles end |
