summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/xmake.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/rules/c++/modules/xmake.lua')
-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