summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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