summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support/common.lua
diff options
context:
space:
mode:
authorArthur LAURENT <[email protected]>2022-12-01 15:57:04 +0100
committerArthur LAURENT <[email protected]>2022-12-01 15:57:04 +0100
commit6479822a2179db58dab05e0f1b60aa4cf6c48b98 (patch)
treefe4dcf5d7839808afd6680a920da7be975288b32 /xmake/rules/c++/modules/modules_support/common.lua
parente2c6eb2208f05cba0fe499656e2d8de1b70c9410 (diff)
fix msvc.lua
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/common.lua')
-rw-r--r--xmake/rules/c++/modules/modules_support/common.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/xmake/rules/c++/modules/modules_support/common.lua b/xmake/rules/c++/modules/modules_support/common.lua
index 45a1cac2f..b21613f61 100644
--- a/xmake/rules/c++/modules/modules_support/common.lua
+++ b/xmake/rules/c++/modules/modules_support/common.lua
@@ -446,10 +446,10 @@ function fallback_generate_dependencies(target, jsonfile, sourcefile, preprocess
sourcecode = sourcecode:gsub("/%*.-%*/", "")
for _, line in ipairs(sourcecode:split("\n", {plain = true})) do
if not module_name_export then
- module_name_export = line:match("export%s+module%s+(.+)%s*;")
+ module_name_export = line:match("export%s+module%s+(.+)%s*;") or line:match("export%s+__preprocessed_module%s+(.+)%s*;")
end
if not module_name_private then
- module_name_private = line:match("module%s+(.+)%s*;")
+ module_name_private = line:match("module%s+(.+)%s*;") or line:match("__preprocessed_module%s+(.+)%s*;")
end
local module_depname = line:match("import%s+(.+)%s*;")
-- we need parse module interface dep in cxx/impl_unit.cpp, e.g. hello.mpp and hello_impl.cpp
@@ -487,6 +487,7 @@ function fallback_generate_dependencies(target, jsonfile, sourcefile, preprocess
local provide = {}
provide["logical-name"] = module_name_export
provide["source-path"] = path.absolute(sourcefile, project.directory())
+ provide["is-interface"] = true
rule.provides = {}
table.insert(rule.provides, provide)