summaryrefslogtreecommitdiff
path: root/xmake/rules/c++/modules/modules_support/msvc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/msvc.lua')
-rw-r--r--xmake/rules/c++/modules/modules_support/msvc.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/xmake/rules/c++/modules/modules_support/msvc.lua b/xmake/rules/c++/modules/modules_support/msvc.lua
index 93eef7c8c..04d34f02c 100644
--- a/xmake/rules/c++/modules/modules_support/msvc.lua
+++ b/xmake/rules/c++/modules/modules_support/msvc.lua
@@ -174,7 +174,8 @@ function generate_user_headerunits(target, batchcmds, headerunits, opt)
if headerunit.type == ":quote" then
outputdir = path.join(cachedir, path.directory(path.relative(headerunit.path, projectdir)))
else
- outputdir = path.join(cachedir, path.directory(headerunit.path):sub(3))
+ -- if path is relative then its a subtarget path
+ outputdir = path.join(cachedir, path.is_absolute(headerunit.path) and path.directory(headerunit.path):sub(3) or headerunit.path)
end
batchcmds:mkdir(outputdir)