aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/buildgen
diff options
context:
space:
mode:
authorGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2015-01-15 06:47:41 +0100
committerGravatar Nicolas "Pixel" Noble <pixel@nobis-crew.org>2015-01-15 06:49:36 +0100
commitcc0994c8cbd302aa99483e42d6d2855b0cd59fd4 (patch)
treea67ad22adb910104ae36b90c0cfaf90bea8c52d6 /tools/buildgen
parentb876c68bcc7e9a6cd553bc687a4e696fe7eafa36 (diff)
Factoring visual studio code into a buildgen plugin.
Diffstat (limited to 'tools/buildgen')
-rwxr-xr-xtools/buildgen/plugins/generate_vsprojects.py38
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..36eb8f7008
--- /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.
+
+"""
+
+
+import re
+
+
+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)
+ 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.get('c++', False)]
+
+ project_dict = dict([(p['name'], p) for p in projects])
+
+ dictionary['vsprojects'] = projects
+ dictionary['vsproject_dict'] = project_dict