diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2022-04-08 17:21:54 +0200 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-04-12 18:25:38 -0400 |
commit | 589600cb51534decf1ce2a10e4739dc1d4c26ae0 (patch) | |
tree | 0c5598c894142526b211bac3e3f3c9092b545fe0 /mesonbuild/dependencies/dev.py | |
parent | 0176419becd232ec09cc6edf7255c562849c1d3f (diff) | |
download | meson-589600cb51534decf1ce2a10e4739dc1d4c26ae0.zip meson-589600cb51534decf1ce2a10e4739dc1d4c26ae0.tar.gz meson-589600cb51534decf1ce2a10e4739dc1d4c26ae0.tar.bz2 |
cmake: Always use all compilers for LLVM (fixes #10249)
Diffstat (limited to 'mesonbuild/dependencies/dev.py')
-rw-r--r-- | mesonbuild/dependencies/dev.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/mesonbuild/dependencies/dev.py b/mesonbuild/dependencies/dev.py index c2bef0d..97d1633 100644 --- a/mesonbuild/dependencies/dev.py +++ b/mesonbuild/dependencies/dev.py @@ -404,7 +404,18 @@ class LLVMDependencyCMake(CMakeDependency): def __init__(self, name: str, env: 'Environment', kwargs: T.Dict[str, T.Any]) -> None: self.llvm_modules = stringlistify(extract_as_list(kwargs, 'modules')) self.llvm_opt_modules = stringlistify(extract_as_list(kwargs, 'optional_modules')) - super().__init__(name, env, kwargs, language='cpp') + + compilers = None + if kwargs.get('native', False): + compilers = env.coredata.compilers.build + else: + compilers = env.coredata.compilers.host + if not compilers or not all(x in compilers for x in ('c', 'cpp')): + self.is_found = False + mlog.warning('The LLVM dependency was not found via CMake since both a C and C++ compiler are required.') + return + + super().__init__(name, env, kwargs, language='cpp', force_use_global_compilers=True) # Cmake will always create a statically linked binary, so don't use # cmake if dynamic is required |