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/linkers.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/linkers.py')
-rw-r--r-- | mesonbuild/linkers.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mesonbuild/linkers.py b/mesonbuild/linkers.py index 5432514..c6302bf 100644 --- a/mesonbuild/linkers.py +++ b/mesonbuild/linkers.py @@ -26,8 +26,9 @@ class StaticLinker: class VisualStudioLinker(StaticLinker): always_args = ['/NOLOGO'] - def __init__(self, exelist): + def __init__(self, exelist, machine): self.exelist = exelist + self.machine = machine def get_exelist(self): return self.exelist[:] @@ -39,7 +40,11 @@ class VisualStudioLinker(StaticLinker): return [] def get_output_args(self, target): - return ['/OUT:' + target] + args = [] + if self.machine: + args += ['/MACHINE:' + self.machine] + args += ['/OUT:' + target] + return args def get_coverage_link_args(self): return [] |