diff options
author | Guillaume Poirier-Morency <guillaumepoiriermorency@gmail.com> | 2017-04-09 23:13:58 -0400 |
---|---|---|
committer | Guillaume Poirier-Morency <guillaumepoiriermorency@gmail.com> | 2017-05-08 14:58:52 -0400 |
commit | 904ed5a59989b1cacc71da51508ba9b04db28fe1 (patch) | |
tree | 628a65bc244a789ffd64519c9ad5afc09376acf2 /mesonbuild/backend/backends.py | |
parent | ccab7d64f474f00e010b2c6601e63d8034c5552a (diff) | |
download | meson-904ed5a59989b1cacc71da51508ba9b04db28fe1.zip meson-904ed5a59989b1cacc71da51508ba9b04db28fe1.tar.gz meson-904ed5a59989b1cacc71da51508ba9b04db28fe1.tar.bz2 |
Use 'generate_basic_compiler_args' for Vala targets
Move '-C' option into 'get_always_args' as we always generate C sources.
Add a branch in the dependency management to perform Vala-specific work
of adding '--pkg' and '--target-glib'.
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r-- | mesonbuild/backend/backends.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 419d04f..b903f4c 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -419,7 +419,18 @@ class Backend: # NOTE: We must preserve the order in which external deps are # specified, so we reverse the list before iterating over it. for dep in reversed(target.get_external_deps()): - commands += dep.get_compile_args() + if compiler.language == 'vala': + if isinstance(dep, dependencies.PkgConfigDependency): + if dep.name == 'glib-2.0' and dep.version_reqs is not None: + for req in dep.version_reqs: + if req.startswith(('>=', '==')): + commands += ['--target-glib', req[2:]] + break + commands += ['--pkg', dep.name] + elif isinstance(dep, dependencies.ExternalLibrary): + commands += dep.get_lang_args('vala') + else: + commands += dep.get_compile_args() # Qt needs -fPIC for executables # XXX: We should move to -fPIC for all executables if isinstance(target, build.Executable): |