Skip to content

Commit

Permalink
add a fileconfig entry to disable module culling
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthapz committed Jul 21, 2024
1 parent e5ba7a1 commit a220695
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
10 changes: 10 additions & 0 deletions tests/projects/c++/modules/culling2/src/hello.mpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module;
#include <cstdio>

export module hello;

export namespace hello {
void say(const char* str) {
printf("%s\n", str);
}
}
1 change: 1 addition & 0 deletions tests/projects/c++/modules/culling2/test.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
inherit(".test_base")
6 changes: 6 additions & 0 deletions tests/projects/c++/modules/culling2/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
add_rules("mode.release", "mode.debug")
set_languages("c++20")

target("culling")
set_kind("static")
add_files("src/*.mpp", {cull = true})
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ function sort_modules_by_dependencies(target, objectfiles, modules)
local _, provide, cppfile = compiler_support.get_provided_module(modules[objectfile])
local fileconfig = target:fileconfig(cppfile)
local public = fileconfig and fileconfig.public
if not provide or public then
if not provide or public or (fileconfig.cull ~= nil and not fileconfig.cull) then
table.insert(result, objectfile)
end
else
Expand Down

0 comments on commit a220695

Please sign in to comment.