summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2024-07-24 02:40:14 +0200
committerArthur LAURENT <[email protected]>2024-07-24 02:40:14 +0200
commit61a90f5cd7c5e9882378127f88c809a890f1a8d8 (patch)
tree0a030bc00b0fd5fcb809c351f8c08052a55c2768
parentd7e9d430ccc5de6162f9f361983d1f50a16a179b (diff)
fix objectfiles culling
-rw-r--r--xmake/rules/c++/modules/modules_support/dependency_scanner.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/xmake/rules/c++/modules/modules_support/dependency_scanner.lua b/xmake/rules/c++/modules/modules_support/dependency_scanner.lua
index f4ac77712..c2dce1203 100644
--- a/xmake/rules/c++/modules/modules_support/dependency_scanner.lua
+++ b/xmake/rules/c++/modules/modules_support/dependency_scanner.lua
@@ -438,9 +438,14 @@ function sort_modules_by_dependencies(target, objectfiles, modules, opt)
for _, objectfile in ipairs(objectfiles_sorted) do
local name, provide, cppfile = compiler_support.get_provided_module(modules[objectfile])
local fileconfig = target:fileconfig(cppfile)
- local public = fileconfig and fileconfig.public
- local external = fileconfig and fileconfig.external
- local can_cull = (fileconfig and fileconfig.cull ~= nil) and fileconfig.cull or true
+ local public
+ local external
+ local can_cull = true
+ if fileconfig then
+ public = fileconfig.public
+ external = fileconfig.external
+ can_cull = fileconfig.cull == nil and true or fileconfig.cull
+ end
can_cull = can_cull and target:policy("build.c++.modules.culling")
local insert = true
if provide then