diff options
| author | Arthur Vasseur <[email protected]> | 2026-06-03 16:56:39 +0200 |
|---|---|---|
| committer | Arthur Vasseur <[email protected]> | 2026-06-03 17:14:58 +0200 |
| commit | e5acd354bec225e633eeb8ad08f0b397ff20e7d9 (patch) | |
| tree | 8d353a9475e2f287acf0b22026e2c8349f6c3779 /xmake/plugins | |
| parent | c2dd4195391125636743b9ebb70a794349a6f7ce (diff) | |
plugin/format: xmake format plugin: skip path.join when headerfile path is already absolute
On Windows, path.join(projectdir, absolutePath) concatenates instead of replacing, producing oubled paths like projectdir/C:/...full/path.
Source batch files happen to be relative so they were unaffected. headerfiles are absolute and triggered the bug.
Diffstat (limited to 'xmake/plugins')
| -rw-r--r-- | xmake/plugins/format/main.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xmake/plugins/format/main.lua b/xmake/plugins/format/main.lua index fe05d86c6..7d5e1de66 100644 --- a/xmake/plugins/format/main.lua +++ b/xmake/plugins/format/main.lua @@ -185,12 +185,12 @@ function main() for _, target in ipairs(targets) do for _, source in ipairs(target:sourcefiles()) do if _match_sourcefiles(source, filepatterns) then - table.insert(sourcefiles, path.join(projectdir, source)) + table.insert(sourcefiles, path.absolute(source, projectdir)) end end for _, header in ipairs(target:headerfiles()) do if _match_sourcefiles(header, filepatterns) then - table.insert(sourcefiles, path.join(projectdir, header)) + table.insert(sourcefiles, path.absolute(header, projectdir)) end end end @@ -199,12 +199,12 @@ function main() for _, sourcebatch in pairs(target:sourcebatches()) do if _source_batch_should_format(sourcebatch) then for _, source in ipairs(sourcebatch.sourcefiles) do - table.insert(sourcefiles, path.join(projectdir, source)) + table.insert(sourcefiles, path.absolute(source, projectdir)) end end end for _, header in ipairs(target:headerfiles()) do - table.insert(sourcefiles, path.join(projectdir, header)) + table.insert(sourcefiles, path.absolute(header, projectdir)) end end end |
