diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2018-06-19 09:31:32 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2018-06-20 11:27:08 +0000 |
commit | d73748815014b8b4bbbd7fe7fb8b50b8a75aecfc (patch) | |
tree | dc535b92cd6f496fbc6cb4153fad7449f286d45a /mesonbuild/compilers | |
parent | ebda6ef9c801278bd15a6499c80fff26071feded (diff) | |
download | meson-d73748815014b8b4bbbd7fe7fb8b50b8a75aecfc.zip meson-d73748815014b8b4bbbd7fe7fb8b50b8a75aecfc.tar.gz meson-d73748815014b8b4bbbd7fe7fb8b50b8a75aecfc.tar.bz2 |
dependencies: Don't assume self.compiler is a C compiler
All dependencies were using find_library, has_header, get_define, etc on
self.compiler assuming that it's a compiler that outputs and consumes
C-like libraries. This is not true for D (and in the future, for Rust)
since although they can consume C libraries, they do not use the
C ecosystem.
For such purposes, we now have self.clib_compiler. Nothing uses
self.compiler anymore as a result, and it has been removed.
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r-- | mesonbuild/compilers/__init__.py | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/compilers.py | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/compilers/__init__.py b/mesonbuild/compilers/__init__.py index 122f969..8c5a7f7 100644 --- a/mesonbuild/compilers/__init__.py +++ b/mesonbuild/compilers/__init__.py @@ -27,6 +27,7 @@ __all__ = [ 'all_languages', 'base_options', + 'clib_langs', 'clike_langs', 'c_suffixes', 'cpp_suffixes', @@ -103,6 +104,7 @@ from .compilers import ( ICC_STANDARD, all_languages, base_options, + clib_langs, clike_langs, c_suffixes, cpp_suffixes, diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 64d6d1c..2c48d07 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -48,9 +48,13 @@ lang_suffixes = { all_languages = lang_suffixes.keys() cpp_suffixes = lang_suffixes['cpp'] + ('h',) c_suffixes = lang_suffixes['c'] + ('h',) +# List of languages that by default consume and output libraries following the +# C ABI; these can generally be used interchangebly +clib_langs = ('objcpp', 'cpp', 'objc', 'c', 'fortran',) # List of languages that can be linked with C code directly by the linker # used in build.py:process_compilers() and build.py:get_dynamic_linker() -clike_langs = ('d', 'objcpp', 'cpp', 'objc', 'c', 'fortran', ) +# XXX: Add Rust to this? +clike_langs = ('d',) + clib_langs clike_suffixes = () for _l in clike_langs + ('vala',): clike_suffixes += lang_suffixes[_l] |