structured_sources: Allow build_tgt to be added as source
In some cases, there is a need to use a built library as a "source" for another target. Specifically Java JAR might want to contain their own native JNI libraries in order to provide a single file "executable".
I'm kind of surprised this works out of the box without any further changes 🙃
Can you please extend a test?
@tristan957 added
seems like this needs at least java 9. Is it enough to bump the dependency('jni') or do I need to add another mechanism the skip the builds for java 1.8?
I don't think you need a whole new test for this. I would extend this one: https://github.com/mesonbuild/meson/tree/master/test%20cases/java/9%20jni. What do you think?
@dcbaker is there any other place that would be a good test in addition to this? Not sure if there is a more generic structured_sources test.
I don't think you need a whole new test for this. I would extend this one: https://github.com/mesonbuild/meson/tree/master/test%20cases/java/9%20jni. What do you think?
I've thought about it, but it doesn't really work well with how the test is structured in src/ and lib/. As first we need to generate the native headers in the src/ tree, then compile the library (lib/) that is then again needed in src/ for the structured_sources call.
One could generate the native headers in lib/, but then your throwing long paths around and I'd want to avoid that.
If you see a good way to refactor the existing test, that would be fine.
We need to get the image jobs to pass. Not your fault. I'm working on fixing Fedora.
If you rebase on master, you should pick up the Fedora CI fixes. I think msys2 will also start to pass.
Status report:
- Arch is failing due to mirror issues
- openSUSE & Ubuntu have issues with "dub" dependencies (no idea what that is or how to fix it)
- Fedora has issues with zlib
I have added a PR to really fix the fedora test at #13436