summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-04-06 00:30:49 +0800
committerruki <[email protected]>2023-04-06 00:30:49 +0800
commitd21367e79a12e8f05829df3eb6509f8f86e64405 (patch)
treee5727836469d15748d3054a4068cacd1740ef111
parent315229f079381cbb3e89bcd602d1173451d0ceb2 (diff)
improve filegroup #3598
-rw-r--r--xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua6
-rw-r--r--xmake/plugins/project/vsxmake/getinfo.lua6
2 files changed, 10 insertions, 2 deletions
diff --git a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua
index d418afb34..f9f358acb 100644
--- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua
+++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua
@@ -88,7 +88,11 @@ function _make_filter(filepath, target, vcxprojdir)
filter = path.normalize(filegroup)
else
-- file tree mode (default)
- filter = path.normalize(path.join(filegroup, path.directory(fileitem)))
+ if filegroup ~= "" then
+ filter = path.normalize(path.join(filegroup, path.directory(fileitem)))
+ else
+ filter = path.normalize(path.directory(fileitem))
+ end
end
if filter and filter == '.' then
filter = nil
diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua
index d66d462a6..b1bb537ef 100644
--- a/xmake/plugins/project/vsxmake/getinfo.lua
+++ b/xmake/plugins/project/vsxmake/getinfo.lua
@@ -394,7 +394,11 @@ function _make_filter(filepath, target, vcxprojdir)
filter = path.normalize(filegroup)
else
-- file tree mode (default)
- filter = path.normalize(path.join(filegroup, path.directory(fileitem)))
+ if filegroup ~= "" then
+ filter = path.normalize(path.join(filegroup, path.directory(fileitem)))
+ else
+ filter = path.normalize(path.directory(fileitem))
+ end
end
if filter and filter == '.' then
filter = nil