aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend
diff options
context:
space:
mode:
authorGustavoLCR <gugulcr@gmail.com>2021-11-17 20:50:19 -0300
committerEli Schwartz <eschwartz93@gmail.com>2021-11-21 01:42:02 -0500
commit2771e352bd819179696f9a7cd3e8df956e1f9923 (patch)
tree502a99b0882795306f4b1df0e5390715700a72de /mesonbuild/backend
parente67c07c0063e3513b8b304e481400f05722e1de5 (diff)
downloadmeson-2771e352bd819179696f9a7cd3e8df956e1f9923.zip
meson-2771e352bd819179696f9a7cd3e8df956e1f9923.tar.gz
meson-2771e352bd819179696f9a7cd3e8df956e1f9923.tar.bz2
Fix vs backend cross compilation regression
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r--mesonbuild/backend/vs2010backend.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py
index 8ec8087..6885c63 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?