The minimum supported API version must be specified when building the native libraries, otherwise this may cause linking errors when launching the app.
The minimum API level is increased to 24 (Android 7.0, covering 97.2% of usages) because:
- Vulkan is only available from API 24+ on ARM64 and x64.
- curl only compiles with API 23+.
- The NDK version we use supports only API 21+.
Ensure that the C++/Linker flags are set when building Android libraries, which was causing errors due to `-fPIC` not being set for all libraries.
Split the `compile_source` function into `compile_source_android` and `compile_source_webasm` instead of using a parameter to switch between the functionality.
Use [cargo-ndk](https://github.com/bbqsrc/cargo-ndk) to configure cargo for building with the Android NDK. The output of `cargo ndk` is written to a subfolder for the target triplet, which cannot be changed by parameter. Therefore, the `CARGO_BUILD_DIR` is changed to this subfolder for the Android build, so the build process can find the output.
Use `$HOME` instead of `~` because cargo-ndk cannot correctly access the folder otherwise (will fail with error message indicating it could not determine the NDK version).
Add `DDNET_TEST_NO_LINK=ON` CMake argument, to fix Rust linking errors with tests.
Add additional CMake arguments to specify system name, API version and NDK location. Upgrade to Android API 34.
Use `nproc` instead of `32` threads for building.