From a5094a134aa8b2a971153ed8446f27d986f476e7 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 16 Jun 2025 08:44:10 -0700 Subject: vala: add a method to get a generated vala header This allows targets that don't link with a vala target to rely on the header generation. --- docs/markdown/Vala.md | 13 +++++++++++++ docs/markdown/snippets/vala-target-extra-methods.md | 12 ++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 docs/markdown/snippets/vala-target-extra-methods.md (limited to 'docs/markdown') diff --git a/docs/markdown/Vala.md b/docs/markdown/Vala.md index fdc4fbae4..23ff57018 100644 --- a/docs/markdown/Vala.md +++ b/docs/markdown/Vala.md @@ -304,6 +304,19 @@ In this example, the second and third elements of the `install_dir` array indicate the destination with `true` to use default directories (i.e. `include` and `share/vala/vapi`). +### Depending on C header + +*(since 1.10.0)* + +Given the previous example, + +```meson +foo_lib = shared_library(...) +foo_h = foo_lib.vala_header() +``` + +This header can now be used like any other generated header to create an +order-only dependency. ### GObject Introspection and language bindings diff --git a/docs/markdown/snippets/vala-target-extra-methods.md b/docs/markdown/snippets/vala-target-extra-methods.md new file mode 100644 index 000000000..1c7867e4f --- /dev/null +++ b/docs/markdown/snippets/vala-target-extra-methods.md @@ -0,0 +1,12 @@ +## Vala BuildTarget dependency enhancements + +A BuildTarget that has Vala sources can now get a File dependency for its +generated header. + +```meson +lib = library('foo', 'foo.vala') +lib_h = lib.vala_header() +lib_s = static_lib('static', 'static.c', lib_h) +``` + +`static.c` will not start compilation until `lib.h` is generated. -- cgit v1.2.3