diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-03-19 20:39:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-19 20:39:34 +0200 |
commit | 44dd5535f056922294867bac2eb07b57f21bede6 (patch) | |
tree | ef603fb176951caac7201046d0204a6e489a7791 /mesonbuild/compilers | |
parent | 3d0b110ec2e5e0e9eddc4dcfeb925e6f62dbcba0 (diff) | |
parent | a223b20bb60c7c643d3d4e9581101e5f54522c57 (diff) | |
download | meson-44dd5535f056922294867bac2eb07b57f21bede6.zip meson-44dd5535f056922294867bac2eb07b57f21bede6.tar.gz meson-44dd5535f056922294867bac2eb07b57f21bede6.tar.bz2 |
Merge pull request #4724 from jon-turney/lib-machine-always
Fix linking when cross-compiling and a windows resource is first object
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r-- | mesonbuild/compilers/c.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index 3548b6d..6ab14d2 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -1399,6 +1399,13 @@ class VisualStudioCCompiler(CCompiler): self.base_options = ['b_pch', 'b_ndebug', 'b_vscrt'] # FIXME add lto, pgo and the like self.target = target self.is_64 = ('x64' in target) or ('x86_64' in target) + # do some canonicalization of target machine + if 'x86_64' in target: + self.machine = 'x64' + elif '86' in target: + self.machine = 'x86' + else: + self.machine = target # Override CCompiler.get_always_args def get_always_args(self): @@ -1475,7 +1482,7 @@ class VisualStudioCCompiler(CCompiler): return ['/nologo'] def get_linker_output_args(self, outputname): - return ['/OUT:' + outputname] + return ['/MACHINE:' + self.machine, '/OUT:' + outputname] def get_linker_search_args(self, dirname): return ['/LIBPATH:' + dirname] |