summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxq114 <[email protected]>2022-02-28 22:58:25 +0800
committerxq114 <[email protected]>2022-02-28 22:58:25 +0800
commitaec3f5e191140bcc4f60ba05cc6484bb3c942459 (patch)
tree17fbc121cd8bd2c077fffc7c354b023a3bfa77cb
parenta76408793027b1aca6b8938a51e5d121bb42084b (diff)
fix vsxmake generator
-rw-r--r--xmake/plugins/project/vsxmake/getinfo.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua
index 446dfc32d..26351fa4c 100644
--- a/xmake/plugins/project/vsxmake/getinfo.lua
+++ b/xmake/plugins/project/vsxmake/getinfo.lua
@@ -468,11 +468,12 @@ function main(outputdir, vsinfo)
for _, target in pairs(targets) do
target._paths = {}
local dirs = {}
- local root = target.absscriptdir or project.directory()
- target.sourcefiles = table.imap(target.sourcefiles, function(_, v) return path.relative(v, root) end)
- target.headerfiles = table.imap(target.headerfiles, function(_, v) return path.relative(v, root) end)
+ local projectdir = project.directory()
+ local root = target.absscriptdir or projectdir
+ target.sourcefiles = table.imap(target.sourcefiles, function(_, v) return path.relative(v, projectdir) end)
+ target.headerfiles = table.imap(target.headerfiles, function(_, v) return path.relative(v, projectdir) end)
for _, f in ipairs(table.join(target.sourcefiles, target.headerfiles)) do
- local dir = path.directory(f)
+ local dir = path.directory(path.relative(f, root))
local escaped_f = _escape(f)
-- @see https://github.com/xmake-io/xmake/issues/2039
dir = _strip_dotdirs(dir)