Merge branch 'vs-soln-gen' into 'master'

msvs: Update project sorting in visual studio solution file

See merge request ita1024/waf!2319
This commit is contained in:
ita1024 2021-03-13 06:10:54 +00:00
commit b8bcf0dbb6
1 changed files with 5 additions and 1 deletions

View File

@ -787,8 +787,12 @@ class msvs_generator(BuildContext):
self.collect_dirs()
default_project = getattr(self, 'default_project', None)
def sortfun(x):
if x.name == default_project:
# folders should sort to the top
if getattr(x, 'VS_GUID_SOLUTIONFOLDER', None):
return ''
# followed by the default project
elif x.name == default_project:
return ' '
return getattr(x, 'path', None) and x.path.win32path() or x.name
self.all_projects.sort(key=sortfun)