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:
parent
268b9c10c9
commit
fc24eadc62
@ -346,6 +346,7 @@ $(foreach ide,\
|
|||||||
debug \
|
debug \
|
||||||
kdevelop \
|
kdevelop \
|
||||||
vs2012 \
|
vs2012 \
|
||||||
|
vs2013 \
|
||||||
vim \
|
vim \
|
||||||
xcode, \
|
xcode, \
|
||||||
$(eval $(call gb_Top_GbuildToIdeIntegration,$(ide))))
|
$(eval $(call gb_Top_GbuildToIdeIntegration,$(ide))))
|
||||||
|
@ -216,8 +216,9 @@ class GbuildParser:
|
|||||||
|
|
||||||
class IdeIntegrationGenerator:
|
class IdeIntegrationGenerator:
|
||||||
|
|
||||||
def __init__(self, gbuildparser):
|
def __init__(self, gbuildparser, ide):
|
||||||
self.gbuildparser = gbuildparser
|
self.gbuildparser = gbuildparser
|
||||||
|
self.ide = ide
|
||||||
|
|
||||||
def emit(self):
|
def emit(self):
|
||||||
pass
|
pass
|
||||||
@ -225,8 +226,8 @@ class IdeIntegrationGenerator:
|
|||||||
|
|
||||||
class DebugIntegrationGenerator(IdeIntegrationGenerator):
|
class DebugIntegrationGenerator(IdeIntegrationGenerator):
|
||||||
|
|
||||||
def __init__(self, gbuildparser):
|
def __init__(self, gbuildparser, ide):
|
||||||
IdeIntegrationGenerator.__init__(self, gbuildparser)
|
IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
|
||||||
|
|
||||||
def emit(self):
|
def emit(self):
|
||||||
print(self.gbuildparser.srcdir)
|
print(self.gbuildparser.srcdir)
|
||||||
@ -239,8 +240,8 @@ class DebugIntegrationGenerator(IdeIntegrationGenerator):
|
|||||||
|
|
||||||
class VimIntegrationGenerator(IdeIntegrationGenerator):
|
class VimIntegrationGenerator(IdeIntegrationGenerator):
|
||||||
|
|
||||||
def __init__(self, gbuildparser):
|
def __init__(self, gbuildparser, ide):
|
||||||
IdeIntegrationGenerator.__init__(self, gbuildparser)
|
IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
|
||||||
|
|
||||||
def emit(self):
|
def emit(self):
|
||||||
global_list = []
|
global_list = []
|
||||||
@ -423,8 +424,8 @@ VersionControl=kdevgit
|
|||||||
includedirfile.write('\n'.join(include))
|
includedirfile.write('\n'.join(include))
|
||||||
includedirfile.close()
|
includedirfile.close()
|
||||||
|
|
||||||
def __init__(self, gbuildparser):
|
def __init__(self, gbuildparser, ide):
|
||||||
IdeIntegrationGenerator.__init__(self, gbuildparser)
|
IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
|
||||||
self.target_by_location = {}
|
self.target_by_location = {}
|
||||||
self.target_by_path = {}
|
self.target_by_path = {}
|
||||||
for target in set(self.gbuildparser.libs) | set(self.gbuildparser.exes):
|
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),
|
self.write_dict_to_plist(self.generate_project(modulename),
|
||||||
open(os.path.join(xcodeprojdir, 'project.pbxproj'), 'w'))
|
open(os.path.join(xcodeprojdir, 'project.pbxproj'), 'w'))
|
||||||
|
|
||||||
def __init__(self, gbuildparser):
|
def __init__(self, gbuildparser, ide):
|
||||||
IdeIntegrationGenerator.__init__(self, gbuildparser)
|
IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
|
||||||
self.target_by_location = {}
|
self.target_by_location = {}
|
||||||
for target in set(self.gbuildparser.libs) | set(self.gbuildparser.exes):
|
for target in set(self.gbuildparser.libs) | set(self.gbuildparser.exes):
|
||||||
if target.location not in self.target_by_location:
|
if target.location not in self.target_by_location:
|
||||||
@ -632,8 +633,9 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
|
|||||||
|
|
||||||
class VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
|
class VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
|
||||||
|
|
||||||
def __init__(self, gbuildparser):
|
def __init__(self, gbuildparser, ide):
|
||||||
IdeIntegrationGenerator.__init__(self, gbuildparser)
|
IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
|
||||||
|
self.toolset = self.retrieve_toolset(ide)
|
||||||
self.solution_directory = './'
|
self.solution_directory = './'
|
||||||
self.configurations = {
|
self.configurations = {
|
||||||
'Build': {
|
'Build': {
|
||||||
@ -660,6 +662,10 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
|
|||||||
self.target_by_location[target.location] = set()
|
self.target_by_location[target.location] = set()
|
||||||
self.target_by_location[target.location] |= set([target])
|
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):
|
def module_make_command(self, targets):
|
||||||
return '%(sh)s -c "PATH=\\"/bin:$PATH\\"; cd %(location)s && %(makecmd)s -rs ' + 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'
|
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
|
# 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 = 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')
|
import_node = ET.SubElement(proj_node, '{%s}Import' % ns, Project='$(VCTargetsPath)\Microsoft.Cpp.props')
|
||||||
ET.SubElement(proj_node, '{%s}ImportGroup' % ns, Label='ExtensionSettings')
|
ET.SubElement(proj_node, '{%s}ImportGroup' % ns, Label='ExtensionSettings')
|
||||||
@ -894,6 +900,7 @@ if __name__ == '__main__':
|
|||||||
'kdevelop': KdevelopIntegrationGenerator,
|
'kdevelop': KdevelopIntegrationGenerator,
|
||||||
'xcode': XcodeIntegrationGenerator,
|
'xcode': XcodeIntegrationGenerator,
|
||||||
'vs2012': VisualStudioIntegrationGenerator,
|
'vs2012': VisualStudioIntegrationGenerator,
|
||||||
|
'vs2013': VisualStudioIntegrationGenerator,
|
||||||
'vim': VimIntegrationGenerator,
|
'vim': VimIntegrationGenerator,
|
||||||
'debug': DebugIntegrationGenerator}
|
'debug': DebugIntegrationGenerator}
|
||||||
|
|
||||||
@ -906,7 +913,7 @@ if __name__ == '__main__':
|
|||||||
else:
|
else:
|
||||||
gbuildparser = GbuildParser().parse(sys.stdin)
|
gbuildparser = GbuildParser().parse(sys.stdin)
|
||||||
|
|
||||||
generators[args.ide](gbuildparser).emit()
|
generators[args.ide](gbuildparser, args.ide).emit()
|
||||||
|
|
||||||
# Local Variables:
|
# Local Variables:
|
||||||
# indent-tabs-mode: nil
|
# indent-tabs-mode: nil
|
||||||
|
Loading…
x
Reference in New Issue
Block a user