From 3ba0073df6014d4b594df052f8e1fa75ce17b20e Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Fri, 19 Jul 2019 10:34:11 -0400 Subject: Make 'default_library' per-subproject builtin option Currently it's just like if all builtin/base/compiler options are yielding. This patch makes possible to have non-yielding builtin options. The value in is overriden in this order: - Value from parent project - Value from subproject's default_options if set - Value from subproject() default_options if set - Value from command line if set --- docs/markdown/Reference-manual.md | 3 ++- docs/markdown/snippets/per_subproject_builtin.md | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 docs/markdown/snippets/per_subproject_builtin.md (limited to 'docs/markdown') diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index ae6d1c5..510d443 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -1553,7 +1553,8 @@ arguments: that override those set in the subproject's `meson_options.txt` (like `default_options` in `project`, they only have effect when Meson is run for the first time, and command line arguments override - any default options in build files) + any default options in build files). *Since 0.54.0* `default_library` + built-in option can also be overridden. - `version` keyword argument that works just like the one in `dependency`. It specifies what version the subproject should be, as an example `>=1.0.1` diff --git a/docs/markdown/snippets/per_subproject_builtin.md b/docs/markdown/snippets/per_subproject_builtin.md new file mode 100644 index 0000000..44ed1c8 --- /dev/null +++ b/docs/markdown/snippets/per_subproject_builtin.md @@ -0,0 +1,15 @@ +## Per subproject `default_library` option + +The `default_library` built-in option can now be defined per subproject. This is +useful for example when building shared libraries in the main project, but static +link a subproject. + +Most of the time this would be used either by the parent project by setting +subproject's default_options (e.g. `subproject('foo', default_options: 'default_library=static')`), +or by the user using the command line `-Dfoo:default_library=static`. + +The value is overriden in this order: +- Value from parent project +- Value from subproject's default_options if set +- Value from subproject() default_options if set +- Value from command line if set -- cgit v1.1