-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can custom_target generate source code in the source tree instead of in the build directory? #5434
Comments
You can't generate anything with meson in the source tree (that is, you can, but meson will expect to find generated files in the build dir): "Meson is different from some other build systems in that it does not permit in-source builds. You must always create a separate build directory." (https://mesonbuild.com/Tutorial.html). If you REALLY want to generate files only once, you can create a following
|
Thanks very much for the response! |
Almost all of the time the overhead of generating sources multiple is insignificant compared to the time it takes to compile them. If this is the case, the simplest solution is to regenerate them for each build dir. |
The symlink approach seems working OK. Thanks. The next question is, how can I make sure the generated code in the external folder can be deleted by running "ninja -t clean ". Currently it will only delete the symlink. |
You can't, because (It would be possible to create a custom wrapper that both runs ninja -t clean, and manually deletes additional files. This would be like manually creating a |
Hi,
I'd like to use custom_target() to run omniidl to generate C++ source and header files within my source tree. I can make omniidl to generate files in anywhere I want... but the problem is when I pass the custom_target() object into the static_library() function as a source, meson expects the generated files to be inside of the build directory.
The reason I want the generated files to be in the source tree is that they can be used to build my application for different CPU architectures. For example, I'll have a build directory for Intel and another build directory for ARM. I don't want to generate the same set of files twice.
I'd appreciate any ideas/advice. Thanks!
The text was updated successfully, but these errors were encountered: