summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2025-08-17 23:10:59 +0800
committerruki <[email protected]>2025-08-17 23:10:59 +0800
commit3fd6e799c8ec2c7203a862f4252bdbe2bcf4cb61 (patch)
treef8335e91283806be7f265ab46a11d743b7f236a5 /xmake/modules
parent62692a409f31cb14e527f37da59dd2767d4af3f2 (diff)
fix path #6720
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/private/utils/batchcmds.lua16
1 files changed, 9 insertions, 7 deletions
diff --git a/xmake/modules/private/utils/batchcmds.lua b/xmake/modules/private/utils/batchcmds.lua
index 465fe301c..944507397 100644
--- a/xmake/modules/private/utils/batchcmds.lua
+++ b/xmake/modules/private/utils/batchcmds.lua
@@ -279,14 +279,16 @@ function batchcmds:compile(sourcefiles, objectfile, opt)
opt.target = self._TARGET
-- wrap path for sourcefiles, because we need to translate path for project generator
- if type(sourcefiles) == "table" then
- local sourcefiles_wrap = {}
- for _, sourcefile in ipairs(sourcefiles) do
- table.insert(sourcefiles_wrap, path(sourcefile))
+ if not path.instance_of(sourcefiles) then
+ if type(sourcefiles) == "table" then
+ local sourcefiles_wrap = {}
+ for _, sourcefile in ipairs(sourcefiles) do
+ table.insert(sourcefiles_wrap, path(sourcefile))
+ end
+ sourcefiles = sourcefiles_wrap
+ else
+ sourcefiles = path(sourcefiles)
end
- sourcefiles = sourcefiles_wrap
- else
- sourcefiles = path(sourcefiles)
end
-- load compiler and get compilation command