diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2019-01-05 15:18:17 +0000 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2019-01-05 20:22:13 +0000 |
commit | a223b20bb60c7c643d3d4e9581101e5f54522c57 (patch) | |
tree | 253d5342b479cb9c30a7fc988d75132dc532c39d /mesonbuild/environment.py | |
parent | 818c1619cc15785d95b492eab80746ee403e08e3 (diff) | |
download | meson-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.py | 2 |
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: |