Handle linking to liblog when [cross] building for Android using meson. #2784
+12
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When cross building with meson for the Android NDK, and additional link to liblog is required but was missing from the meson build directives. This adds checking in the meson build directives for if the system is android. Without linking the build will give the following error:
While testing I also tried a build on Termux and found that it too needed to have liblog linked, but in meson on Termux the system is reported as 'linux' instead of 'android', so I added a big of a hack to detect Termux by checking for its system data folder.
Test for both builds ran successfully on my Android device under Termux, but I had to copy over some .so libraries for the NDK build as the test doesn't statically link them - it doesn't seem particularly necessary for me but if this is an issue please comment and I'll try to add detection for NDK and impose a static build on the self test.
Also note I added the 'fs' module include toward the top of the meson.build file because that feels more "correct" to me.