aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/environment.py
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2019-01-05 15:18:17 +0000
committerJon Turney <jon.turney@dronecode.org.uk>2019-01-05 20:22:13 +0000
commita223b20bb60c7c643d3d4e9581101e5f54522c57 (patch)
tree253d5342b479cb9c30a7fc988d75132dc532c39d /mesonbuild/environment.py
parent818c1619cc15785d95b492eab80746ee403e08e3 (diff)
downloadmeson-a223b20bb60c7c643d3d4e9581101e5f54522c57.zip
meson-a223b20bb60c7c643d3d4e9581101e5f54522c57.tar.gz
meson-a223b20bb60c7c643d3d4e9581101e5f54522c57.tar.bz2
Fix linking when cross-compiling and a windows resource is first object
It appears that LIB/LINK default to the host architecture if they can't guess it from the first object. With the MSVC toolchain, resource files are (usually) compiled to an arch-neutral .res format. Always explicitly provide a '/MACHINE:' argument to avoid it guessing incorrectly when cross-compiling.
Diffstat (limited to 'mesonbuild/environment.py')
-rw-r--r--mesonbuild/environment.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index 71f75f9..f0fa1da 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -1050,7 +1050,7 @@ class Environment:
popen_exceptions[' '.join(linker + [arg])] = e
continue
if '/OUT:' in out.upper() or '/OUT:' in err.upper():
- return VisualStudioLinker(linker)
+ return VisualStudioLinker(linker, getattr(compiler, 'machine', None))
if p.returncode == 0 and ('armar' in linker or 'armar.exe' in linker):
return ArmarLinker(linker)
if 'DMD32 D Compiler' in out or 'DMD64 D Compiler' in out: