gbuild-to-ide: Add support for vs2013

Change-Id: I385e756109ab0a47feeeb4407ba4a2a4b68548dd
Reviewed-on: https://gerrit.libreoffice.org/11728
Reviewed-by: Peter Foley <pefoley2@verizon.net>
Tested-by: Peter Foley <pefoley2@verizon.net>
This commit is contained in:
David Ostrovsky 2014-10-01 01:44:20 +02:00 committed by Peter Foley
parent 268b9c10c9
commit fc24eadc62
2 changed files with 21 additions and 13 deletions

View file

@ -346,6 +346,7 @@ $(foreach ide,\
debug \
kdevelop \
vs2012 \
vs2013 \
vim \
xcode, \
$(eval $(call gb_Top_GbuildToIdeIntegration,$(ide))))

View file

@ -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