mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-25 11:19:52 +01:00
msvs: Update project sorting in visual studio solution file
In order to correctly set a default project in visual studio any folders must be listed at the top of the solution file. This change ensures that any folders included in generated solutions sort to the top of the .sln file. The default project, if one exists, will be located after the folders. Note that it should also be correct to place the default at the top of the file, followed by any folders.
This commit is contained in:
parent
28318c9cca
commit
68ff6f13b2
@ -787,8 +787,12 @@ class msvs_generator(BuildContext):
|
|||||||
self.collect_dirs()
|
self.collect_dirs()
|
||||||
default_project = getattr(self, 'default_project', None)
|
default_project = getattr(self, 'default_project', None)
|
||||||
def sortfun(x):
|
def sortfun(x):
|
||||||
if x.name == default_project:
|
# folders should sort to the top
|
||||||
|
if getattr(x, 'VS_GUID_SOLUTIONFOLDER', None):
|
||||||
return ''
|
return ''
|
||||||
|
# followed by the default project
|
||||||
|
elif x.name == default_project:
|
||||||
|
return ' '
|
||||||
return getattr(x, 'path', None) and x.path.win32path() or x.name
|
return getattr(x, 'path', None) and x.path.win32path() or x.name
|
||||||
self.all_projects.sort(key=sortfun)
|
self.all_projects.sort(key=sortfun)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user