Skip to content

Cross compilation for android ndk #146

Answered by K-os
remul19 asked this question in Q&A
Jun 29, 2023 · 3 comments · 3 replies
Discussion options

You must be logged in to vote

Cross compilation for Android is straight forward using CMake as documented here:
https://developer.android.com/ndk/guides/cmake#command-line

For example to build for arm64/aarch64:

cmake -S . -B build/android -DCMAKE_TOOLCHAIN_FILE=${ANDROID_HOME}/ndk/25.2.9519653/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a  -DVVDEC_TOPLEVEL_OUTPUT_DIRS=0 -DCMAKE_BUILD_TYPE=Release
cmake --build build/android

The only thing specific to vvdec, that I am doing here is setting VVDEC_TOPLEVEL_OUTPUT_DIRS=0. That way the output will be written to build/android/{bin,lib}/ instead of the bin/ and lib/ directories in the top level source dir, so it doesn't interfere with any builds for the curre…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@remul19
Comment options

Answer selected by remul19
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@remul19
Comment options

@remul19
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants