diff options
author | Lars Persson <larper@axis.com> | 2017-05-11 18:26:16 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-05-14 19:01:14 +0300 |
commit | a1a4f66e6d915c1f6aae2ead02cf5631b10c76f1 (patch) | |
tree | 3e1a278c830ebc70dad74b54b09f2242443051d6 /mesonbuild/dependencies/base.py | |
parent | 18b11489cf43fcc251d1cc04e087d8cea191a258 (diff) | |
download | meson-a1a4f66e6d915c1f6aae2ead02cf5631b10c76f1.zip meson-a1a4f66e6d915c1f6aae2ead02cf5631b10c76f1.tar.gz meson-a1a4f66e6d915c1f6aae2ead02cf5631b10c76f1.tar.bz2 |
gtestdependency: find libraries using the compiler
Use the compiler object to find gtest libraries. Fixes following
cases:
- cross compiling looked in host library paths
- static libgtest was not supported
Change-Id: If42cdf873db38676b99adca60752f652aff097a2
Diffstat (limited to 'mesonbuild/dependencies/base.py')
-rw-r--r-- | mesonbuild/dependencies/base.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index b934ddf..f4ecd57 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -639,3 +639,16 @@ def find_external_dependency(name, environment, kwargs): raise pkg_exc mlog.log('Dependency', mlog.bold(name), 'found:', mlog.red('NO')) return pkgdep + +def dependency_get_compiler(language, environment, kwargs): + if 'native' in kwargs and environment.is_cross_build(): + want_cross = not kwargs['native'] + else: + want_cross = environment.is_cross_build() + + if want_cross: + compilers = environment.coredata.cross_compilers + else: + compilers = environment.coredata.compilers + + return compilers.get(language, None) |