From 392bfd76e4e21b5d49b62aee8f2bbadbd4bdb20c Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 4 Oct 2024 00:56:47 +0800 Subject: [PATCH] fix module batch --- xmake/rules/c++/modules/xmake.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xmake/rules/c++/modules/xmake.lua b/xmake/rules/c++/modules/xmake.lua index 4874082cfb..f967dd133d 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