From 0e3394f7123b6d63b91c1c55f227253f21cba343 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sun, 30 Jun 2024 18:45:58 +0500 Subject: [PATCH] vs-ide-integration: set correct solution / project platform This allows the IDE to show active #ifdef conditions, type sizes, alignment, memory layout, selected overloads, and so on. Change-Id: Idd1211df3b3745658f1996a494929b07cf7aa573 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169772 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- bin/gbuild-to-ide | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide index ef1e27dd6748..b3f8b9fbd371 100755 --- a/bin/gbuild-to-ide +++ b/bin/gbuild-to-ide @@ -866,6 +866,12 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator): def __init__(self, gbuildparser, ide): IdeIntegrationGenerator.__init__(self, gbuildparser, ide) self.toolset = os.environ['VCTOOLSET'] + if os.environ['CPUNAME'] == 'X86_64': + self.platform = 'x64' + elif os.environ['CPUNAME'] == 'AARCH64': + self.platform = 'ARM' + else: # 'INTEL' + self.platform = 'Win32' self.solution_directory = self.gbuildparser.builddir self.configurations = { 'Build': { @@ -995,7 +1001,7 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator): f.write('EndProject\n') # end Folders to group tests/libraries/executables f.write('Global\n') - platform = 'Win32' + platform = self.platform f.write('\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n') for cfg in self.configurations: f.write('\t\t%(cfg)s|%(platform)s = %(cfg)s|%(platform)s\n' % {'cfg': cfg, 'platform': platform}) @@ -1071,7 +1077,7 @@ class VisualStudioIntegrationGenerator(IdeIntegrationGenerator): ET.register_namespace('', self.ns) proj_node = ET.Element('{%s}Project' % self.ns, DefaultTargets='Build', ToolsVersion='4.0') proj_confs_node = ET.SubElement(proj_node, '{%s}ItemGroup' % self.ns, Label='ProjectConfigurations') - platform = 'Win32' + platform = self.platform for configuration in self.configurations: proj_conf_node = ET.SubElement(proj_confs_node, '{%s}ProjectConfiguration' % self.ns,