diff options
| author | ruki <[email protected]> | 2022-08-24 22:37:40 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-08-24 22:37:40 +0800 |
| commit | e94c67aea65b7b64246a79b7f125c11f3268371d (patch) | |
| tree | 2d4c39d9517cc49fadee76a69e47331d3e951db0 /xmake/rules/c++/modules/modules_support/common.lua | |
| parent | 0864717f9b9afae5c3fa1a983605b7df2abba8fd (diff) | |
fix modules for gcc
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/common.lua')
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/common.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/xmake/rules/c++/modules/modules_support/common.lua b/xmake/rules/c++/modules/modules_support/common.lua index 580d52dd9..734a2d070 100644 --- a/xmake/rules/c++/modules/modules_support/common.lua +++ b/xmake/rules/c++/modules/modules_support/common.lua @@ -390,17 +390,20 @@ function fallback_generate_dependencies(target, jsonfile, sourcefile) if not module_name then module_name = line:match("export%s+module%s+(.+)%s*;") end + if not module_name then + module_name = line:match("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 -- @see https://github.com/xmake-io/xmake/pull/2664#issuecomment-1213167314 if not module_depname and not has_module_extension(sourcefile) then - module_depname = line:match("module%s+(.+)%s*;") + module_depname = module_name end if module_depname then local module_dep = {} -- partition? import :xxx; if module_depname:startswith(":") then - module_depname = module_name .. module_depname + module_depname = (module_name or "") .. module_depname elseif module_depname:startswith("\"") then module_depname = module_depname:sub(2, -2) module_dep["lookup-method"] = "include-quote" |
