You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a project that I'm migrating from plain GNU Make to Meson. It uses a custom rpc protocol with an idl schema. To make things simple, there's a scheme.idl split in so-called namespaces.
Let's assume there are following namespaces: foo, bar, baz (the actual list of them is pretty large).
To get things working, the current flow is
For each namespace run tdl2cpp -m ${namespace} -d ${OUT}. The resulting file structure is something like this:
Compile the ${n}/details/${n}.cpp file for each namespace. Note that foo/details/foo.cpp may reference bar/types.h and vice versa, so the generation stage must precede the compilation
Selectively link needed namespace .o file
So, I came up with the following Meson build definition:
Unfortunately, Meson errors out with ERROR: custom_target keyword argument "output" Output 'foo/details/foo.cpp' must not contain a path segment.
I'm totally lost :/. The only possible workaround I see is creating a separate directory for each namespace and copy-pasting the same definition. Given 30 namespaces, having 30 nearly-identical files is a sign of smelly code.
And even then, the problem with +1 nested details directory is yet to be solved, idl2cpp generates the files in a single pass and its behavior is not configurable in this relation.
Do you have any ideas how to solve this nice and clean, without code sparsity and duplication?
P.S. I came across #2320 , but one of the proposed workarounds with run_command does not work, since idl2cpp is a Meson executable target
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello!
I have a project that I'm migrating from plain GNU Make to Meson. It uses a custom rpc protocol with an idl schema. To make things simple, there's a
scheme.idl
split in so-called namespaces.Let's assume there are following namespaces: foo, bar, baz (the actual list of them is pretty large).
To get things working, the current flow is
tdl2cpp -m ${namespace} -d ${OUT}
. The resulting file structure is something like this:${n}/details/${n}.cpp
file for each namespace. Note thatfoo/details/foo.cpp
may referencebar/types.h
and vice versa, so the generation stage must precede the compilationSo, I came up with the following Meson build definition:
Unfortunately, Meson errors out with
ERROR: custom_target keyword argument "output" Output 'foo/details/foo.cpp' must not contain a path segment.
I'm totally lost :/. The only possible workaround I see is creating a separate directory for each namespace and copy-pasting the same definition. Given 30 namespaces, having 30 nearly-identical files is a sign of smelly code.
And even then, the problem with +1 nested
details
directory is yet to be solved, idl2cpp generates the files in a single pass and its behavior is not configurable in this relation.Do you have any ideas how to solve this nice and clean, without code sparsity and duplication?
P.S. I came across #2320 , but one of the proposed workarounds with
run_command
does not work, since idl2cpp is a Meson executable targetBeta Was this translation helpful? Give feedback.
All reactions