[Libreoffice-commits] core.git: bin/gbuild-to-ide Makefile.in

David Ostrovsky david at ostrovsky.org
Thu Oct 2 17:29:50 PDT 2014


 Makefile.in       |    1 +
 bin/gbuild-to-ide |   33 ++++++++++++++++++++-------------
 2 files changed, 21 insertions(+), 13 deletions(-)

New commits:
commit fc24eadc6283cd03397b70fda309a578ce295f16
Author: David Ostrovsky <david at ostrovsky.org>
Date:   Wed Oct 1 01:44:20 2014 +0200

    gbuild-to-ide: Add support for vs2013
    
    Change-Id: I385e756109ab0a47feeeb4407ba4a2a4b68548dd
    Reviewed-on: https://gerrit.libreoffice.org/11728
    Reviewed-by: Peter Foley <pefoley2 at verizon.net>
    Tested-by: Peter Foley <pefoley2 at verizon.net>

diff --git a/Makefile.in b/Makefile.in
index 9f5dd1a..a06b3b3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -346,6 +346,7 @@ $(foreach ide,\
 	debug \
 	kdevelop \
 	vs2012 \
+	vs2013 \
 	vim \
 	xcode, \
 $(eval $(call gb_Top_GbuildToIdeIntegration,$(ide))))
diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index b4932d4..dae2313 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -216,8 +216,9 @@ class GbuildParser:
 
 class IdeIntegrationGenerator:
 
-    def __init__(self, gbuildparser):
+    def __init__(self, gbuildparser, ide):
         self.gbuildparser = gbuildparser
+        self.ide = ide
 
     def emit(self):
         pass
@@ -225,8 +226,8 @@ class IdeIntegrationGenerator:
 
 class DebugIntegrationGenerator(IdeIntegrationGenerator):
 
-    def __init__(self, gbuildparser):
-        IdeIntegrationGenerator.__init__(self, gbuildparser)
+    def __init__(self, gbuildparser, ide):
+        IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
 
     def emit(self):
         print(self.gbuildparser.srcdir)
@@ -239,8 +240,8 @@ class DebugIntegrationGenerator(IdeIntegrationGenerator):
 
 class VimIntegrationGenerator(IdeIntegrationGenerator):
 
-    def __init__(self, gbuildparser):
-        IdeIntegrationGenerator.__init__(self, gbuildparser)
+    def __init__(self, gbuildparser, ide):
+        IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
 
     def emit(self):
         global_list = []
@@ -423,8 +424,8 @@ VersionControl=kdevgit
         includedirfile.write('\n'.join(include))
         includedirfile.close()
 
-    def __init__(self, gbuildparser):
-        IdeIntegrationGenerator.__init__(self, gbuildparser)
+    def __init__(self, gbuildparser, ide):
+        IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
         self.target_by_location = {}
         self.target_by_path = {}
         for target in set(self.gbuildparser.libs) | set(self.gbuildparser.exes):
@@ -616,8 +617,8 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
         self.write_dict_to_plist(self.generate_project(modulename),
                                  open(os.path.join(xcodeprojdir, 'project.pbxproj'), 'w'))
 
-    def __init__(self, gbuildparser):
-        IdeIntegrationGenerator.__init__(self, gbuildparser)
+    def __init__(self, gbuildparser, ide):
+        IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
         self.target_by_location = {}
         for target in set(self.gbuildparser.libs) | set(self.gbuildparser.exes):
             if target.location not in self.target_by_location:
@@ -632,8 +633,9 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
 
 class VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
 
-    def __init__(self, gbuildparser):
-        IdeIntegrationGenerator.__init__(self, gbuildparser)
+    def __init__(self, gbuildparser, ide):
+        IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
+        self.toolset = self.retrieve_toolset(ide)
         self.solution_directory = './'
         self.configurations = {
             'Build': {
@@ -660,6 +662,10 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
                 self.target_by_location[target.location] = set()
             self.target_by_location[target.location] |= set([target])
 
+    def retrieve_toolset(self, ide):
+        ide_toolset_map = {'vs2012':'v110', 'vs2013':'v120'}
+        return ide_toolset_map[ide]
+
     def module_make_command(self, targets):
         return '%(sh)s -c "PATH=\\"/bin:$PATH\\"; cd %(location)s && %(makecmd)s -rs ' + targets + '"'
 
@@ -775,7 +781,7 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
             conf_type_node.text = 'Makefile'
             # VS2012: I need to have this otherwise the names of projects will contain text Visual Studio 2010 in the Solution Explorer
             platform_toolset_node = ET.SubElement(conf_node, '{%s}PlatformToolset' % ns)
-            platform_toolset_node.text = 'v110'
+            platform_toolset_node.text = self.toolset
 
         import_node = ET.SubElement(proj_node, '{%s}Import' % ns, Project='$(VCTargetsPath)\Microsoft.Cpp.props')
         ET.SubElement(proj_node, '{%s}ImportGroup' % ns, Label='ExtensionSettings')
@@ -894,6 +900,7 @@ if __name__ == '__main__':
         'kdevelop': KdevelopIntegrationGenerator,
         'xcode': XcodeIntegrationGenerator,
         'vs2012': VisualStudioIntegrationGenerator,
+        'vs2013': VisualStudioIntegrationGenerator,
         'vim': VimIntegrationGenerator,
         'debug': DebugIntegrationGenerator}
 
@@ -906,7 +913,7 @@ if __name__ == '__main__':
     else:
         gbuildparser = GbuildParser().parse(sys.stdin)
 
-    generators[args.ide](gbuildparser).emit()
+    generators[args.ide](gbuildparser, args.ide).emit()
 
 # Local Variables:
 # indent-tabs-mode: nil


More information about the Libreoffice-commits mailing list