diff options
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/common.lua')
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/common.lua | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/xmake/rules/c++/modules/modules_support/common.lua b/xmake/rules/c++/modules/modules_support/common.lua index 4314fd4a5..ac555f778 100644 --- a/xmake/rules/c++/modules/modules_support/common.lua +++ b/xmake/rules/c++/modules/modules_support/common.lua @@ -443,8 +443,7 @@ function fallback_generate_dependencies(target, jsonfile, sourcefile, preprocess local module_deps = {} local module_deps_set = hashset.new() local sourcecode = preprocess_file(sourcefile) or io.readfile(sourcefile) - local fileconfig = target:fileconfig(sourcefile) - local internalpartition = (fileconfig and fileconfig.values) and fileconfig.values["internalpartition"] or false + local internal = false sourcecode = sourcecode:gsub("//.-\n", "\n") sourcecode = sourcecode:gsub("/%*.-%*/", "") for _, line in ipairs(sourcecode:split("\n", {plain = true})) do @@ -453,9 +452,9 @@ function fallback_generate_dependencies(target, jsonfile, sourcefile, preprocess end if not module_name_private then module_name_private = line:match("module%s+(.+)%s*;") or line:match("__preprocessed_module%s+(.+)%s*;") - end - if internalpartition then - module_name_export = module_name_private + if module_name_private then + internal = module_name_private:find(":") + end 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,13 +486,13 @@ function fallback_generate_dependencies(target, jsonfile, sourcefile, preprocess end end - if module_name_export then - table.insert(rule.outputs, module_name_export .. bmi_extension(target)) + if module_name_export or internal then + table.insert(rule.outputs, (module_name_export or module_name_private) .. bmi_extension(target)) local provide = {} - provide["logical-name"] = module_name_export + provide["logical-name"] = module_name_export or module_name_private provide["source-path"] = path.absolute(sourcefile, project.directory()) - provide["is-interface"] = not internalpartition + provide["is-interface"] = not internal rule.provides = {} table.insert(rule.provides, provide) |
