diff options
Diffstat (limited to 'tools/buildgen/plugins/generate_vsprojects.py')
-rwxr-xr-x | tools/buildgen/plugins/generate_vsprojects.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tools/buildgen/plugins/generate_vsprojects.py b/tools/buildgen/plugins/generate_vsprojects.py new file mode 100755 index 0000000000..982e6812e6 --- /dev/null +++ b/tools/buildgen/plugins/generate_vsprojects.py @@ -0,0 +1,38 @@ +"""Buildgen vsprojects plugin. + +This parses the list of libraries, and generates globals "vsprojects" +and "vsproject_dict", to be used by the visual studio generators. + +""" + + +def mako_plugin(dictionary): + """The exported plugin code for generate_vsprojeccts + + We want to help the work of the visual studio generators. + + """ + + libs = dictionary.get('libs', []) + targets = dictionary.get('targets', []) + + for lib in libs: + lib['is_library'] = True + for target in targets: + target['is_library'] = False + + projects = [] + projects.extend(libs) + projects.extend(targets) + # Exclude projects without a visual project guid, such as the tests. + projects = [project for project in projects + if project.get('vs_project_guid', None)] + + # Exclude C++ projects for now + projects = [project for project in projects + if not project['language'] == 'c++'] + + project_dict = dict([(p['name'], p) for p in projects]) + + dictionary['vsprojects'] = projects + dictionary['vsproject_dict'] = project_dict |