Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix android ndk build #23

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Fernthedev
Copy link

So I believe this PR fixes the issues related to building with Android NDK.

NDK Version: 23.1.7779620
CMake version: 3.22.1
Build command:

BUILD_DIR=${BUILD_DIR:-.build}

ANDROID_NDK_CMAKE="-DCMAKE_BUILD_TYPE=Release -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_API=24 -DANDROID_PLATFORM=24 -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DCMAKE_ANDROID_NDK=$ANDROID_NDK_ROOT -DCMAKE_ANDROID_STL_TYPE=c++_static -DCMAKE_CXX_STANDARD=20 -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake -DFMTLOG_IGNORE_SHARED=TRUE -DFMTLOG_SKIP_BENCHMARKS=TRUE -DFMTLOG_SKIP_TEST_BUILD=TRUE" 

mkdir -p "$BUILD_DIR" \
  && cd "$BUILD_DIR" \
  && cmake $ANDROID_NDK_CMAKE -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..\
  && cmake --build . -j

For whatever reason, the tests and benchmarks do not compile on NDK and they seem to be a bigger problem to solve than skip. For the purposes of this PR, I'll just be skipping them as I don't believe they are critical.

However, I do imagine that building the shared library is important. I'm not sure why CMake cannot properly link functions to fmt while building shared. I do know that it works if you build without NDK though.

I'm willing to provide logs if required. Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant