diff options
| author | ruki <[email protected]> | 2023-01-07 20:37:01 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-01-07 20:37:01 +0800 |
| commit | d07547fb49474e9822c7ac14031b90c5b6d78bd2 (patch) | |
| tree | 9609cac2f00de8efdfbaa7ccb87397c7151589f7 /xmake/rules/c++/modules/modules_support | |
| parent | 2c2c67e67ba3076ff7d418af4b27e7381aa7269a (diff) | |
Update common.lua
Diffstat (limited to 'xmake/rules/c++/modules/modules_support')
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/common.lua | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/xmake/rules/c++/modules/modules_support/common.lua b/xmake/rules/c++/modules/modules_support/common.lua index 5d3907dfb..5f1f72599 100644 --- a/xmake/rules/c++/modules/modules_support/common.lua +++ b/xmake/rules/c++/modules/modules_support/common.lua @@ -108,15 +108,16 @@ function parse_meta_info(target, metafile) return metadata._VENDOR_extension.xmake.file, metadata._VENDOR_extension.xmake.name, metadata end - local file = path.basename(metafile) + local filename = path.basename(metafile) + local metadir = path.directory(metafile) for _, ext in ipairs({".mpp", ".mxx", ".cppm", ".ixx"}) do - if os.isfile(path.join(path.directory(metafile), file .. ext)) then - file = file .. ext + if os.isfile(path.join(metadir, filename .. ext)) then + filename = filename .. ext break end end - local sourcecode = io.readfile(path.join(path.directory(metafile), file)) + local sourcecode = io.readfile(path.join(path.directory(metafile), filename)) sourcecode = sourcecode:gsub("//.-\n", "\n") sourcecode = sourcecode:gsub("/%*.-%*/", "") @@ -128,7 +129,7 @@ function parse_meta_info(target, metafile) end end - return file, name, metadata + return filename, name, metadata end -- extract packages modules dependencies |
