Open madebr opened 2 years ago
Do you mean runtime-only dependencies?
I think so, yes.
In this case, libpng16.so
-> libz.so
, I mean a runtime-only dependency that should always be satisfied.
I'll need to think about this a bit. I don't know if CMake is capable of expressing those constraints, and I'm fairly certain ndk-build is not. Hopefully I'm wrong and we can use those mechanisms to convey this info, otherwise this is going to be mostly if not all a feature of whatever system integrates prefab (AGP in your case). Prefab probably needs to carry the metadata to support that though.
I just encountered this cmake property: ANDROID_NATIVE_LIB_DEPENDENCIES
.
Does the android build system respect this property?
If it does, this can also fix #160
The docs don't say that property actually does anything, so hard to say. I've never encountered it before, but it's worth a shot.
Too bad. It is not used when creating the .apk.
I replaced these lines with:
set_target_properties(sdlcross PROPERTIES ANDROID_NATIVE_LIB_DEPENDENCIES SDL2_image::external_libpng)
and removed build
and .cxx
to make sure no old state was kept..
btw, I'm not sure when someone will be free to implement either of these FRs. I'm plenty convinced of the need, but it'll be a bit before anyone is free to investigate.
Once someone is available, I suspect it will take quite some time for those to land since it will probably require a trip through the AGP release cycle. We can fix and ship Prefab fast, but AGP's a much larger product and has an appropriately larger release process. If the fixes can happen entirely in Prefab and don't require AGP involvement it could probably ship within days of being implemented, but I think is very unlikely, given that it's a packaging issue and that's mostly out of prefab's hands.
Probably not what you wanted to hear, but probably better than not knowing.
That's no problem with me.
We have a workaround (use target_link_libraries
). It's not perfect, but it works.
Great. I've bundled up the two FRs and the bug you just filed into a GitHub Project to track a 2.1.0 release. You'll have to take my word for that, because apparently I don't have the permissions to make that publicly visible :(
Is your feature request related to a problem? Please describe. I want to package 2 shared libraries that depend on each other (
LIB_A
->LIB_B
). Right now, this can be modelled by adding":LIB_B"
toexport_libraries
of themodule.json
ofLIB_A
.But the generated prefab
xxxConfig.cmake
contains:This last line is unwanted: it causes every target that links to
LIB_A
to also link toLIB_B
.Describe the solution you'd like Add a field to
module.json
that lists the dependencies, such that the Android build systems knows what extra modules are required.Describe alternatives you've considered Add the extra dependencies to
export_libraries
inmodule.json
, but this results in an unwanted link.Additional context I came across this when modelling SDL_image:
libpng.so
depends onlibz.so
. When needinglibpng.so
, you should not need to link tolibz.so
yourself.