summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2025-06-30 13:45:57 -0700
committerDylan Baker <dylan@pnwbakers.com>2025-12-05 08:13:08 -0800
commitf6918fe65c8b9526bc359bea8a6e8517b39b4ec5 (patch)
treec8be5e054ecfa81dbcbe0350cab03e49328233b5 /docs
parent79854e4b8d09744acbe2f2d2c0d43a88b9ab1dcc (diff)
downloadmeson-f6918fe65c8b9526bc359bea8a6e8517b39b4ec5.tar.gz
mesonmain: mark getting a language from another subproject as broken
Currently, you can call `meson.get_compiler('c')`, if you haven't initialized 'c' for your project, but a super-project has initialized it. This happens because we check the wrong set of compilers (the global list vs the per-subproject one). Because of how fragile this is, we can mark it as broken an move on.
Diffstat (limited to 'docs')
-rw-r--r--docs/markdown/snippets/getting-language-from-other-project.md6
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/markdown/snippets/getting-language-from-other-project.md b/docs/markdown/snippets/getting-language-from-other-project.md
new file mode 100644
index 000000000..79f19baee
--- /dev/null
+++ b/docs/markdown/snippets/getting-language-from-other-project.md
@@ -0,0 +1,6 @@
+## Using `meson.get_compiler()` to get a language from another project is marked broken
+
+Meson currently will return a compiler instance from the `meson.get_compiler()`
+call, if that language has been initialized in any project. This can result in
+situations where a project can only work as a subproject, or if a dependency is
+provided by a subproject rather than by a pre-built dependency.