diff options
| -rw-r--r-- | xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua | 4 | ||||
| -rw-r--r-- | xmake/plugins/project/vsxmake/getinfo.lua | 4 |
2 files changed, 6 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 f9f358acb..eda9518d1 100644 --- a/xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua +++ b/xmake/plugins/project/vstudio/impl/vs201x_vcxproj_filters.lua @@ -65,6 +65,7 @@ end -- make filter function _make_filter(filepath, target, vcxprojdir) local filter + local is_plain = false local filegroups = target.filegroups if filegroups then -- @see https://github.com/xmake-io/xmake/issues/2282 @@ -86,6 +87,7 @@ function _make_filter(filepath, target, vcxprojdir) if filepath:match(filepattern) then if mode == "plain" then filter = path.normalize(filegroup) + is_plain = true else -- file tree mode (default) if filegroup ~= "" then @@ -102,7 +104,7 @@ function _make_filter(filepath, target, vcxprojdir) end end end - if not filter then + if not filter and not is_plain then -- use the default filter rule filter = path.relative(path.absolute(path.directory(filepath)), target.scriptdir or vcxprojdir) -- @see https://github.com/xmake-io/xmake/issues/2039 diff --git a/xmake/plugins/project/vsxmake/getinfo.lua b/xmake/plugins/project/vsxmake/getinfo.lua index b1bb537ef..abfbe2538 100644 --- a/xmake/plugins/project/vsxmake/getinfo.lua +++ b/xmake/plugins/project/vsxmake/getinfo.lua @@ -371,6 +371,7 @@ end -- make filter function _make_filter(filepath, target, vcxprojdir) local filter + local is_plain = false local filegroups = target.filegroups if filegroups then -- @see https://github.com/xmake-io/xmake/issues/2282 @@ -392,6 +393,7 @@ function _make_filter(filepath, target, vcxprojdir) if filepath:match(filepattern) then if mode == "plain" then filter = path.normalize(filegroup) + is_plain = true else -- file tree mode (default) if filegroup ~= "" then @@ -408,7 +410,7 @@ function _make_filter(filepath, target, vcxprojdir) end end end - if not filter then + if not filter and not is_plain then -- use the default filter rule filter = path.relative(path.absolute(path.directory(filepath)), vcxprojdir) -- @see https://github.com/xmake-io/xmake/issues/2039 |
