Simplify VS IDE integration generation

Do not require the IDE version in vs*-ide-integration. Instead, use
VCVER environment variable, that is set in configure, to obtain
the toolset for the VCPROJ files. When introducing support for new
VS version, the 'VisualStudioIntegrationGenerator.retrieve_toolset'
method needs to be updated synchronously to list the toolset.

This simplifies the make command to

  make vs-ide-integration

TODO: also set the toolset in configure, to simplify the code here,
and also in places like external/python3/ExternalProject_python3.mk
(see commit c156a8c708).

Change-Id: I95960029a933be2cab96898eee6be6ca6bc5794a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123162
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski 2021-10-08 09:56:51 +02:00
parent 70138b37bb
commit 27d1cc61b4
2 changed files with 6 additions and 8 deletions

View file

@ -483,8 +483,7 @@ endef
$(foreach ide,\
codelite \
vs2019 \
vs2022 \
vs \
kdevelop \
vim \
qtcreator \

View file

@ -916,7 +916,7 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
def __init__(self, gbuildparser, ide):
IdeIntegrationGenerator.__init__(self, gbuildparser, ide)
self.toolset = self.retrieve_toolset(ide)
self.toolset = self.retrieve_toolset()
self.solution_directory = self.gbuildparser.builddir
self.configurations = {
'Build': {
@ -936,9 +936,9 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator):
}
}
def retrieve_toolset(self, ide):
ide_toolset_map = {'vs2019': 'v142', 'vs2022': 'v143'}
return ide_toolset_map[ide]
def retrieve_toolset(self):
ide_toolset_map = {'160': 'v142', '170': 'v143'}
return ide_toolset_map[os.environ['VCVER']]
def module_make_command(self, targets):
return '%(sh)s -c "PATH=\\"/bin:$PATH\\";BUILDDIR=\\"%(builddir)s\\" %(makecmd)s -rsC %(location)s ' + targets + '"'
@ -1870,8 +1870,7 @@ if __name__ == '__main__':
'eclipsecdt': EclipseCDTIntegrationGenerator,
'kdevelop': KdevelopIntegrationGenerator,
'xcode': XcodeIntegrationGenerator,
'vs2019': VisualStudioIntegrationGenerator,
'vs2022': VisualStudioIntegrationGenerator,
'vs': VisualStudioIntegrationGenerator,
'vim': VimIntegrationGenerator,
'debug': DebugIntegrationGenerator,
'qtcreator': QtCreatorIntegrationGenerator,