diff options
Diffstat (limited to 'mesonbuild/dependencies')
-rw-r--r-- | mesonbuild/dependencies/base.py | 13 | ||||
-rw-r--r-- | mesonbuild/dependencies/dev.py | 3 |
2 files changed, 14 insertions, 2 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py index 2f69b85..ce206b6 100644 --- a/mesonbuild/dependencies/base.py +++ b/mesonbuild/dependencies/base.py @@ -552,9 +552,20 @@ def strip_system_libdirs(environment: 'Environment', for_machine: MachineChoice, in the system path, and a different version not in the system path if they want to link against the non-system path version. """ - exclude = {f'-L{p}' for p in environment.get_compiler_system_dirs(for_machine)} + exclude = {f'-L{p}' for p in environment.get_compiler_system_lib_dirs(for_machine)} return [l for l in link_args if l not in exclude] +def strip_system_includedirs(environment: 'Environment', for_machine: MachineChoice, include_args: T.List[str]) -> T.List[str]: + """Remove -I<system path> arguments. + + leaving these in will break builds where user want dependencies with system + include-type used in rust.bindgen targets as if will cause system headers + to not be found. + """ + + exclude = {f'-I{p}' for p in environment.get_compiler_system_include_dirs(for_machine)} + return [i for i in include_args if i not in exclude] + def process_method_kw(possible: T.Iterable[DependencyMethods], kwargs: T.Dict[str, T.Any]) -> T.List[DependencyMethods]: method = kwargs.get('method', 'auto') # type: T.Union[DependencyMethods, str] if isinstance(method, DependencyMethods): diff --git a/mesonbuild/dependencies/dev.py b/mesonbuild/dependencies/dev.py index a9b768b..9c03496 100644 --- a/mesonbuild/dependencies/dev.py +++ b/mesonbuild/dependencies/dev.py @@ -31,7 +31,7 @@ from mesonbuild.interpreterbase.decorators import FeatureDeprecated from .. import mesonlib, mlog from ..environment import get_llvm_tool_names from ..mesonlib import version_compare, version_compare_many, search_version, stringlistify, extract_as_list -from .base import DependencyException, DependencyMethods, detect_compiler, strip_system_libdirs, SystemDependency, ExternalDependency, DependencyTypeName +from .base import DependencyException, DependencyMethods, detect_compiler, strip_system_includedirs, strip_system_libdirs, SystemDependency, ExternalDependency, DependencyTypeName from .cmake import CMakeDependency from .configtool import ConfigToolDependency from .factory import DependencyFactory @@ -438,6 +438,7 @@ class LLVMDependencyCMake(CMakeDependency): defs = defs[0].split(' ') temp = ['-I' + x for x in inc_dirs] + defs self.compile_args += [x for x in temp if x not in self.compile_args] + self.compile_args = strip_system_includedirs(env, self.for_machine, self.compile_args) if not self._add_sub_dependency(threads_factory(env, self.for_machine, {})): self.is_found = False return |