diff options
| author | ruki <[email protected]> | 2023-04-07 00:36:31 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2023-04-07 00:36:31 +0800 |
| commit | 70200e67d717c4b04d792ae61d297e454d09aef6 (patch) | |
| tree | 5ae9ec29640463a2a5072c74b1ed3dd80896ce53 | |
| parent | 1a94a99d7f4cde9fbaf9e50906d8a37ba12ac8f2 (diff) | |
fix plain group #3598
| -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 |
