diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2019-04-02 00:40:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-02 00:40:05 +0300 |
commit | 75219989ca468923142738d93df8aef64e897b8e (patch) | |
tree | 225bab977e67835540dddc8f0506f51378e861f5 /mesonbuild/compilers/vala.py | |
parent | 663517d23376809fd6bc0b69549ee823a06682d7 (diff) | |
parent | a4b2fbc807e2459f50dc43950753737f558e782b (diff) | |
download | meson-75219989ca468923142738d93df8aef64e897b8e.zip meson-75219989ca468923142738d93df8aef64e897b8e.tar.gz meson-75219989ca468923142738d93df8aef64e897b8e.tar.bz2 |
Merge pull request #5128 from Ericson2314/sanity-check-with-flags
Sanity check with external args
Diffstat (limited to 'mesonbuild/compilers/vala.py')
-rw-r--r-- | mesonbuild/compilers/vala.py | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/mesonbuild/compilers/vala.py b/mesonbuild/compilers/vala.py index b463f0d..98b8b42 100644 --- a/mesonbuild/compilers/vala.py +++ b/mesonbuild/compilers/vala.py @@ -15,7 +15,7 @@ import os.path from .. import mlog -from ..mesonlib import EnvironmentException, version_compare +from ..mesonlib import EnvironmentException, MachineChoice, version_compare from .compilers import Compiler @@ -87,7 +87,16 @@ class ValaCompiler(Compiler): def sanity_check(self, work_dir, environment): code = 'class MesonSanityCheck : Object { }' - with self.compile(code, [], 'compile') as p: + if environment.is_cross_build() and not self.is_cross: + for_machine = MachineChoice.BUILD + else: + for_machine = MachineChoice.HOST + extra_flags = environment.coredata.get_external_args(for_machine, self.language) + if self.is_cross: + extra_flags += self.get_compile_only_args() + else: + extra_flags += environment.coredata.get_external_link_args(for_machine, self.language) + with self.compile(code, extra_flags, 'compile') as p: if p.returncode != 0: msg = 'Vala compiler {!r} can not compile programs' \ ''.format(self.name_string()) @@ -105,8 +114,14 @@ class ValaCompiler(Compiler): # no extra dirs are specified. if not extra_dirs: code = 'class MesonFindLibrary : Object { }' + if env.is_cross_build() and not self.is_cross: + for_machine = MachineChoice.BUILD + else: + for_machine = MachineChoice.HOST + args = env.coredata.get_external_args(for_machine, self.language) vapi_args = ['--pkg', libname] - with self.compile(code, vapi_args, 'compile') as p: + args += vapi_args + with self.compile(code, args, 'compile') as p: if p.returncode == 0: return vapi_args # Not found? Try to find the vapi file itself. |