Using exe
in custom_target
without re-invoking meson
#12040
Replies: 1 comment 4 replies
-
Calling back into meson is required under certain circumstances:
In all these cases we need to minimize the challenges of running commands with a lot of non-portable context. So we have a helper program that can do all these things at once, and uses a pickled data file to load the context so that we don't need to deal with escaping such fiddly data. In the specific case of environment variables, if the Additionally, if the capture/feed kwargs were the only point on the above list, we will use ... In your case, the likely reason is solely down to your executable tool having some dependencies that caused meson to think it needs to set a PATH. Does it link to any dependencies? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Consider the following setup:
Supposing the name of the executable is
tool.exe
, and one of the sources isfoo.c
, then the resultingbuild.ninja
(on Windows at least) will contain a build rule to the following effect:My expectation would be that the
COMMAND
would directly usetool.exe
but instead I see that it calls back in viameson
. I have a significant number of source files that I would like to run this tool on, and the overhead of invokingmeson
for each is nearly equal to the actual runtime of the tool itself.A quick-and-dirty way I could get around this would be to compile
tool.exe
prior to setting up the build directory, and then accessing it viafind_program
; in this instance, theCOMMAND
is exactly what I want (a direct invocation oftool.exe
). I was hoping that there would be a solution within meson so that I don't have to worry about compiler detection or formatting of arguments.Any other approaches to this issue? I would also be interested in knowing why a call-back into
meson
is necessary here.Beta Was this translation helpful? Give feedback.
All reactions