summaryrefslogtreecommitdiffstats
path: root/test cases/common/257 generated header dep/meson.build
diff options
context:
space:
mode:
Diffstat (limited to 'test cases/common/257 generated header dep/meson.build')
-rw-r--r--test cases/common/257 generated header dep/meson.build22
1 files changed, 22 insertions, 0 deletions
diff --git a/test cases/common/257 generated header dep/meson.build b/test cases/common/257 generated header dep/meson.build
new file mode 100644
index 0000000..195d082
--- /dev/null
+++ b/test cases/common/257 generated header dep/meson.build
@@ -0,0 +1,22 @@
+project('generated header dep', 'c')
+
+# Regression test case for a very specific case:
+# - Uses both_libraries(), or library() with default_library=both.
+# - A header file is generated by a custom_target() and passed as source.
+# - A C file that uses that header is passed as a declare_dependency() source.
+# Under those specific conditions, the static library used to miss an order
+# dependency on the header file. This happened in GLib:
+# https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2917.
+
+python = import('python').find_installation()
+header = custom_target(
+ output: 'foo.h',
+ capture: true,
+ command: [python, '-c', 'print("#define FOO")'],
+)
+
+sources_dep = declare_dependency(sources: files('foo.c'))
+
+both_libraries('foo', header,
+ dependencies: sources_dep,
+)