gbuild-to-ide, solved vim problem.

Updated xcode, WIP.

Solved problem with vim.
Remark the vim-ide-integration is not maintained, and cannot be expected
to work as the IDE gets more integrated.

Change-Id: I9d6fe6d2caef7162298814f1ab0d16c7aeb7d895
This commit is contained in:
jan Iversen 2017-01-30 12:09:02 +01:00
parent fc53cce644
commit f41301c163

View File

@ -543,14 +543,15 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
targetId = self.generate_id('PBXNativeTarget') targetId = self.generate_id('PBXNativeTarget')
configurationListId = self.generate_id('XCConfigurationList') configurationListId = self.generate_id('XCConfigurationList')
configurationDebugId = self.generate_id('XCBuildConfiguration') configurationDebugId = self.generate_id('XCBuildConfiguration')
fileId = self.generate_id('XCBuildConfiguration') fileId = self.generate_id('PBXFileReference')
objects = {targetId: self.generate_PBXLegacyTarget(target, configurationListId), objects = {configurationListId: self.generate_XCBuildConfiguration(target, configurationDebugId),
configurationListId: self.generate_XCBuildConfiguration(target, configurationDebugId), #MAKE targetId: self.generate_PBXLegacyTarget(target, configurationListId),
targetId: self.generate_PBXNativeTarget(target, configurationListId),
configurationDebugId: self.generate_XCBuildConfiguration(target, configurationDebugId, debug=True), configurationDebugId: self.generate_XCBuildConfiguration(target, configurationDebugId, debug=True),
fileId : self.generate_PBXFileReference(module, target['LINKTARGET'], explicit=target['build_type']) fileId : self.generate_PBXFileReference(module, target['LINKTARGET'], explicit=target['build_type'])
} }
self.rootObj['attributes']['TargetAttributes'].update({ self.rootObj['attributes']['TargetAttributes'].update(
targetId: {'CreatedOnToolsVersion': '8.2', 'ProvisioningStyle': 'Automatic'}}) {targetId: {'CreatedOnToolsVersion': '8.2', 'ProvisioningStyle': 'Automatic'}})
self.rootObj['buildConfigurationList'] = configurationListId self.rootObj['buildConfigurationList'] = configurationListId
self.rootObj['targets'].append(targetId) self.rootObj['targets'].append(targetId)
targetObj['children'].append(fileId) targetObj['children'].append(fileId)
@ -573,15 +574,35 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
product = 'com.apple.product-type.something' product = 'com.apple.product-type.something'
return {'isa': 'PBXLegacyTarget', return {'isa': 'PBXLegacyTarget',
'buildConfigurationList': configurationListId, 'buildConfigurationList': configurationListId,
'buildArgumentsString': modulename['target_name'], 'buildArgumentsString': modulename['target_name'],
'buildPhases': [], 'buildPhases': [],
'dependencies': [], 'dependencies': [],
'buildToolPath': 'make', 'buildToolPath': 'make',
'buildWorkingDirectory': self.gbuildparser.builddir, 'buildWorkingDirectory': self.gbuildparser.builddir,
'name': modulename['target_name'], 'name': modulename['target_name'],
'productName': modulename['name'], 'productName': modulename['name'],
'passBuildSettingsEnvironment': 1} 'passBuildSettingsEnvironment': 1}
def generate_PBXNativeTarget(self, modulename, configurationListId):
if modulename['build_type'] == 'Library':
product = 'com.apple.product-type.library.dynamic'
elif modulename['build_type'] == 'Executable':
product = 'com.apple.product-type.tool'
elif modulename['build_type'] == 'CppunitTest':
product = 'com.apple.product-type.cppunit'
else:
product = 'com.apple.product-type.something'
return {'isa': 'PBXNativeTarget',
'buildRules': [],
'dependencies': [],
'name': modulename['target_name'],
'productName': modulename['name'],
'productType': product,
'buildConfigurationList': configurationListId,
'buildPhases': [],
'productReference': ''}
def generate_XCBuildConfiguration(self, modulename, configurationDebugId, debug=False): def generate_XCBuildConfiguration(self, modulename, configurationDebugId, debug=False):
if debug: if debug:
@ -639,13 +660,13 @@ class XcodeIntegrationGenerator(IdeIntegrationGenerator):
obj = {'isa': 'PBXFileReference', obj = {'isa': 'PBXFileReference',
'path': module + '/' + filepath, 'path': module + '/' + filepath,
'name': filepath, 'name': filepath,
'fileEncoding': 4,
'sourceTree': '<group>'} 'sourceTree': '<group>'}
if not explicit is None: if not explicit is None:
if explicit == 'Library': if explicit == 'Library':
obj['explicitFileType'] = 'compiled.mach-o.dylib' obj['explicitFileType'] = 'compiled.mach-o.dylib'
else: else:
obj['explicitFileType'] = 'compiled.executable' obj['explicitFileType'] = 'compiled.executable'
obj['includeInIndex'] = 0
obj['path'] = filepath obj['path'] = filepath
else: else:
obj['path'] = module + '/' + filepath obj['path'] = module + '/' + filepath
@ -1074,7 +1095,8 @@ class VimIntegrationGenerator(IdeIntegrationGenerator):
for lib in self.gbuildparser.modules[m]['targets']: for lib in self.gbuildparser.modules[m]['targets']:
entries = [] entries = []
for file in lib['CXXOBJECTS']: for file in lib['CXXOBJECTS']:
filePath = os.path.join(self.gbuildparser.srcdir, file) xFile = lib['module'] + '/' + file
filePath = os.path.join(self.gbuildparser.srcdir, xFile)
entry = {'directory': lib['location'], 'file': filePath, 'command': self.generateCommand(lib, filePath)} entry = {'directory': lib['location'], 'file': filePath, 'command': self.generateCommand(lib, filePath)}
entries.append(entry) entries.append(entry)
global_list.extend(entries) global_list.extend(entries)