aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/markdown/Reference-manual.md3
-rw-r--r--mesonbuild/dependencies/base.py19
2 files changed, 13 insertions, 9 deletions
diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md
index 7668fa0..490ccf0 100644
--- a/docs/markdown/Reference-manual.md
+++ b/docs/markdown/Reference-manual.md
@@ -2148,6 +2148,9 @@ an external dependency with the following methods:
dep3 will add `['-Werror=foo', '-Werror=bar']` to the compiler args
of any target it is added to, but libfoo will not be added to the
link_args.
+
+ *Note*: A bug present until 0.51.0 results in the above behavior
+ not working correctly.
The following arguments will add the following attributes:
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index 1b8818d..a08a677 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -204,18 +204,19 @@ class InternalDependency(Dependency):
def get_partial_dependency(self, *, compile_args: bool = False,
link_args: bool = False, links: bool = False,
includes: bool = False, sources: bool = False):
- compile_args = self.compile_args.copy() if compile_args else []
- link_args = self.link_args.copy() if link_args else []
- libraries = self.libraries.copy() if links else []
- whole_libraries = self.whole_libraries.copy() if links else []
- sources = self.sources.copy() if sources else []
- includes = self.include_directories.copy() if includes else []
- deps = [d.get_partial_dependency(
+ final_compile_args = self.compile_args.copy() if compile_args else []
+ final_link_args = self.link_args.copy() if link_args else []
+ final_libraries = self.libraries.copy() if links else []
+ final_whole_libraries = self.whole_libraries.copy() if links else []
+ final_sources = self.sources.copy() if sources else []
+ final_includes = self.include_directories.copy() if includes else []
+ final_deps = [d.get_partial_dependency(
compile_args=compile_args, link_args=link_args, links=links,
includes=includes, sources=sources) for d in self.ext_deps]
return InternalDependency(
- self.version, includes, compile_args, link_args, libraries,
- whole_libraries, sources, deps)
+ self.version, final_includes, final_compile_args,
+ final_link_args, final_libraries, final_whole_libraries,
+ final_sources, final_deps)
class ExternalDependency(Dependency):