mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 09:59:54 +00:00
Add cmake build instructions for Android (#751)
Co-authored-by: I.Laghidze <developer@artisan-one.com> Co-authored-by: evpobr <evpobr@gmail.com>
This commit is contained in:
parent
dfdad63ff2
commit
01628f48b9
@ -15,3 +15,32 @@ by setting them before the script is run.
|
||||
Since I (erikd), do almost zero Android development, I am happy accept patches
|
||||
for this documentation and script to improve its utility for real Android
|
||||
developers.
|
||||
|
||||
---
|
||||
|
||||
## Using CMake
|
||||
|
||||
(Tested on Linux)
|
||||
|
||||
For convenience, export the following variables:
|
||||
|
||||
```
|
||||
export ANDROID_ABI=arm64-v8a
|
||||
export ANDROID_PLATFORM_API_LEVEL=29
|
||||
export NDK_ROOT=/path/to/android/ndk
|
||||
```
|
||||
|
||||
Set `ANDROID_ABI`, `ANDROID_PLATFORM_API_LEVEL` according to your target system. Now cd into the libsndfile root directory, and run
|
||||
|
||||
```
|
||||
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=$NDK_ROOT/build/cmake/android.toolchain.cmake -DANDROID_ABI=$ANDROID_ABI -DANDROID_PLATFORM=$ANDROID_PLATFORM_API_LEVEL
|
||||
```
|
||||
|
||||
cd into `build` and run make
|
||||
|
||||
```
|
||||
cd build
|
||||
make [-j <number of parallel jobs>]
|
||||
```
|
||||
|
||||
This will build libsndfile for android.
|
||||
|
Loading…
Reference in New Issue
Block a user