From 3a960023d3e78d04651850178db96c7d742725e6 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Tue, 29 Mar 2022 13:52:03 +0200 Subject: interpreter: new function add_project_dependencies() This function can be used to add fundamental dependencies such as glib to all build products in one fell swoop. This can be useful whenever, due to a project's coding conventions, it is not really possible to compile any source file without including the dependency. Signed-off-by: Paolo Bonzini --- docs/markdown/snippets/add_project_dependencies.md | 11 +++++++++++ docs/yaml/functions/add_project_dependencies.yaml | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 docs/markdown/snippets/add_project_dependencies.md create mode 100644 docs/yaml/functions/add_project_dependencies.yaml (limited to 'docs') diff --git a/docs/markdown/snippets/add_project_dependencies.md b/docs/markdown/snippets/add_project_dependencies.md new file mode 100644 index 0000000..193ea55 --- /dev/null +++ b/docs/markdown/snippets/add_project_dependencies.md @@ -0,0 +1,11 @@ +## `add_project_dependencies()` function + +Dependencies can now be added to all build products using +`add_project_dependencies()`. This can be useful in several +cases: + +* with special dependencies such as `dependency('threads')` +* with system libraries such as `find_library('m')` +* with the `include_directories` keyword argument of +`declare_dependency()`, to add both source and build +directories to the include search path diff --git a/docs/yaml/functions/add_project_dependencies.yaml b/docs/yaml/functions/add_project_dependencies.yaml new file mode 100644 index 0000000..03420c5 --- /dev/null +++ b/docs/yaml/functions/add_project_dependencies.yaml @@ -0,0 +1,16 @@ +name: add_project_dependencies +since: 0.63.0 +returns: void +description: | + Adds arguments to the compiler and linker command line, so that the + given set of dependencies is included in all build products for this + project. + + +varargs: + type: dep + name: dependencies + description: The dependencies to add; if internal dependencies are included, + they must not include any built object. + +kwargs_inherit: add_global_arguments -- cgit v1.1