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
This is more of a feature request, and I'd be willing to try implementing it if there's currently no good way to accomplish it and there's an appetite for it. Thought I'd file the bug first to make sure it's not a non-starter.
custom_target lets you pass variables in the command like @BUILD_ROOT@ etc. I want to use these variables in the env as well.
Ok my b I misunderstood @BUILD_ROOT@. What I actually want is only loosely related :/
I'd like to get the path of a file that was generated by a generator. Processing with a generator results in a generated_list, which is specifically documented as an "opaque object".
In this case, I'm passing preserve_path_from: meson.current_source_dir() to the generator's process() method, so the generated file ends up have a path that looks like @BUILD_ROOT@/<target>.p/same/path/structure/as/source (at least on Linux). For my own purposes, I could reconstruct that path using meson.global_build_root(), join_paths() and str.join(), but it's unclear to me if that would be portable, so it seems that a preferable solution would be to somehow inspect the generated_list and get paths by index.
ouillie
changed the title
I want to pass @BUILD_ROOT@ in an environment variable for custom_target
I want to get the path of a generator-processed file
Sep 22, 2022
Describe the bug
This is more of a feature request, and I'd be willing to try implementing it if there's currently no good way to accomplish it and there's an appetite for it. Thought I'd file the bug first to make sure it's not a non-starter.
custom_target
lets you pass variables in thecommand
like@BUILD_ROOT@
etc. I want to use these variables in theenv
as well.To Reproduce
Something like this:
If you run
meson compile -C builddir target && cat build/target
you'll seeFOO=@BUILD_ROOT@
(no substitution occurred).Expected behavior
Should show
FOO=/absolute/path/to/build/root
or whatever.system parameters
meson --version
ninja --version
if it's a Ninja buildThe text was updated successfully, but these errors were encountered: