diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-08 09:56:51 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-08 14:53:48 +0200 |
commit | 27d1cc61b4f58e8ec25463275bee36c96b66b938 (patch) | |
tree | f9ee9b4be364141a1383ad5537fd719281a383d9 | |
parent | 70138b37bb12721b8de6bf9aa42ba5c8b7546ca9 (diff) |
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 c156a8c708f74dd31e1ef024edc578c3915619cb).
Change-Id: I95960029a933be2cab96898eee6be6ca6bc5794a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123162
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r-- | Makefile.in | 3 | ||||
-rwxr-xr-x | bin/gbuild-to-ide | 11 |
2 files changed, 6 insertions, 8 deletions
diff --git a/Makefile.in b/Makefile.in index a71a203d3558..116b1e6bd7c1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -483,8 +483,7 @@ endef $(foreach ide,\ codelite \ - vs2019 \ - vs2022 \ + vs \ kdevelop \ vim \ qtcreator \ diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide index f349a3058aab..8e9d8ba157a6 100755 --- a/bin/gbuild-to-ide +++ b/bin/gbuild-to-ide @@ -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, |