aboutsummaryrefslogtreecommitdiff
path: root/docs/markdown/snippets
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-01-13 19:00:38 +0200
committerGitHub <noreply@github.com>2018-01-13 19:00:38 +0200
commitd6bed2a77df7f7ff4512fd1be6333420d84b71b8 (patch)
treee5be5987b3903e3617973e9a29ded3f8f22c4f9f /docs/markdown/snippets
parent81100f0695c595f4c0020034284846cea7e8e6aa (diff)
parent27d4a611a54251dfab968e3cb111d8cbd6b88254 (diff)
downloadmeson-d6bed2a77df7f7ff4512fd1be6333420d84b71b8.zip
meson-d6bed2a77df7f7ff4512fd1be6333420d84b71b8.tar.gz
meson-d6bed2a77df7f7ff4512fd1be6333420d84b71b8.tar.bz2
Merge pull request #2764 from mesonbuild/generatorpath
Generator outputs can have path segments
Diffstat (limited to 'docs/markdown/snippets')
-rw-r--r--docs/markdown/snippets/gen-subdirs.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/markdown/snippets/gen-subdirs.md b/docs/markdown/snippets/gen-subdirs.md
new file mode 100644
index 0000000..fdb5945
--- /dev/null
+++ b/docs/markdown/snippets/gen-subdirs.md
@@ -0,0 +1,21 @@
+## Generator outputs can preserve directory structure
+
+Normally when generating files with a generator, Meson flattens the
+input files so they all go in the same directory. Some code
+generators, such as Protocol Buffers, require that the generated files
+have the same directory layout as the input files used to generate
+them. This can now be achieved like this:
+
+```meson
+g = generator(...) # Compiles protobuf sources
+generated = gen.process('com/mesonbuild/one.proto',
+ 'com/mesonbuild/two.proto',
+ preserve_path_from : meson.current_source_dir())
+
+This would cause the following files to be generated inside the target
+private directory:
+
+ com/mesonbuild/one.pb.h
+ com/mesonbuild/one.pb.cc
+ com/mesonbuild/two.pb.h
+ com/mesonbuild/two.pb.cc