diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-02-04 23:06:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-04 23:06:46 +0100 |
commit | 902aaf2ce67a8a2a21580685673400f675bf28c1 (patch) | |
tree | 7216a78552e80289ba5ee5f55c638ecb67caec66 /mesonbuild/compilers/d.py | |
parent | 59791fc56966901038aaaac23942bc8ac6e11494 (diff) | |
parent | 19f81d3e33c70c9c902dabaad732e5d33bf05bd4 (diff) | |
download | meson-902aaf2ce67a8a2a21580685673400f675bf28c1.zip meson-902aaf2ce67a8a2a21580685673400f675bf28c1.tar.gz meson-902aaf2ce67a8a2a21580685673400f675bf28c1.tar.bz2 |
Merge pull request #4626 from Ericson2314/consolidate-properties
Go through coreutils.compiler_options.{build.host.target}
Diffstat (limited to 'mesonbuild/compilers/d.py')
-rw-r--r-- | mesonbuild/compilers/d.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py index 3065ac7..1390694 100644 --- a/mesonbuild/compilers/d.py +++ b/mesonbuild/compilers/d.py @@ -14,7 +14,9 @@ import os.path, subprocess -from ..mesonlib import EnvironmentException, version_compare, is_windows, is_osx +from ..mesonlib import ( + EnvironmentException, MachineChoice, version_compare, is_windows, is_osx +) from .compilers import ( CompilerType, @@ -306,12 +308,17 @@ class DCompiler(Compiler): # Add link flags needed to find dependencies args += d.get_link_args() + if env.is_cross_build() and not self.is_cross: + for_machine = MachineChoice.BUILD + else: + for_machine = MachineChoice.HOST + if mode == 'compile': # Add DFLAGS from the env - args += env.coredata.get_external_args(self.language) + args += env.coredata.get_external_args(for_machine, self.language) elif mode == 'link': # Add LDFLAGS from the env - args += env.coredata.get_external_link_args(self.language) + args += env.coredata.get_external_link_args(for_machine, self.language) # extra_args must override all other arguments, so we add them last args += extra_args return args |