summaryrefslogtreecommitdiff
path: root/xmake/rules
diff options
context:
space:
mode:
authorruki <[email protected]>2024-10-04 00:56:47 +0800
committerruki <[email protected]>2024-10-04 00:56:47 +0800
commit392bfd76e4e21b5d49b62aee8f2bbadbd4bdb20c (patch)
treeff4a03b4936b1552f946b495c8cfa979d01cb204 /xmake/rules
parent0505ce114f15e25d0da5b05027754d1c0f06154d (diff)
fix module batch
Diffstat (limited to 'xmake/rules')
-rw-r--r--xmake/rules/c++/modules/xmake.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/xmake/rules/c++/modules/xmake.lua b/xmake/rules/c++/modules/xmake.lua
index 4874082cf..f967dd133 100644
--- a/xmake/rules/c++/modules/xmake.lua
+++ b/xmake/rules/c++/modules/xmake.lua
@@ -56,8 +56,10 @@ rule("c++.build.modules")
-- moduleonly modules are implicitly public
if target:is_moduleonly() then
local sourcebatch = target:sourcebatches()["c++.build.modules.builder"]
- for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
- target:fileconfig_add(sourcefile, {public = true})
+ if sourcebatch then
+ for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
+ target:fileconfig_add(sourcefile, {public = true})
+ end
end
end
end