diff options
author | GustavoLCR <gugulcr@gmail.com> | 2021-11-17 20:50:19 -0300 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2021-11-25 21:13:03 +0530 |
commit | 8b1e76c56fa84570fc3c740a352b5022b31edc1a (patch) | |
tree | 8b0bac46fa3c63c078125e785fc8472e1862976a | |
parent | 07c5abda28acaf269e692dc4cbde86c4c613058a (diff) | |
download | meson-8b1e76c56fa84570fc3c740a352b5022b31edc1a.zip meson-8b1e76c56fa84570fc3c740a352b5022b31edc1a.tar.gz meson-8b1e76c56fa84570fc3c740a352b5022b31edc1a.tar.bz2 |
Fix vs backend cross compilation regression
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index e2f37c4..59e64ff 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -520,18 +520,21 @@ class Vs2010Backend(backends.Backend): temp_dir, guid, conftype = 'Utility', - target_ext = None): + target_ext = None, + target_platform = None): root = ET.Element('Project', {'DefaultTargets': "Build", 'ToolsVersion': '4.0', 'xmlns': 'http://schemas.microsoft.com/developer/msbuild/2003'}) confitems = ET.SubElement(root, 'ItemGroup', {'Label': 'ProjectConfigurations'}) + if not target_platform: + target_platform = self.platform prjconf = ET.SubElement(confitems, 'ProjectConfiguration', - {'Include': self.buildtype + '|' + self.platform}) + {'Include': self.buildtype + '|' + target_platform}) p = ET.SubElement(prjconf, 'Configuration') p.text = self.buildtype pl = ET.SubElement(prjconf, 'Platform') - pl.text = self.platform + pl.text = target_platform # Globals globalgroup = ET.SubElement(root, 'PropertyGroup', Label='Globals') @@ -544,7 +547,7 @@ class Vs2010Backend(backends.Backend): ns.text = target_name p = ET.SubElement(globalgroup, 'Platform') - p.text = self.platform + p.text = target_platform pname = ET.SubElement(globalgroup, 'ProjectName') pname.text = target_name if self.windows_target_platform_version: @@ -613,9 +616,14 @@ class Vs2010Backend(backends.Backend): self._prettyprint_vcxproj_xml(ET.ElementTree(root), ofname) def gen_custom_target_vcxproj(self, target, ofname, guid): + if target.for_machine is MachineChoice.BUILD: + platform = self.build_platform + else: + platform = self.platform (root, type_config) = self.create_basic_project(target.name, temp_dir = target.get_id(), - guid = guid) + guid = guid, + target_platform = platform) # We need to always use absolute paths because our invocation is always # from the target dir, not the build root. target.absolute_paths = True @@ -869,7 +877,8 @@ class Vs2010Backend(backends.Backend): temp_dir = target.get_id(), guid = guid, conftype = conftype, - target_ext = tfilename[1]) + target_ext = tfilename[1], + target_platform = platform) # FIXME: Should these just be set in create_basic_project(), even if # irrelevant for current target? |