Skip to content

jakubslaby09/libgit2-android

 
 

Repository files navigation

What the fork?

This is my fork of libgit2. If anyone else wants to use this fork, keep in mind that there is a dangerous workaround in src/libgit2/repository.c. To revert it, checkout b85ce6a.

Building with Android NDK

  1. Read the warning above!
  2. If you haven't already, download the NDK and extract it
  3. Make sure CMAKE_ANDROID_NDK in the toolchain file is set to the NDK directory
  4. If you want to, change the android API version (CMAKE_SYSTEM_VERSION) or architecture (CMAKE_ANDROID_ARCH_ABI) in that toolchain file
  5. Set the env variable ANDROID_NDK_ROOT to your NDK directory and build openssl
    cd openssl
    PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$ANDROID_NDK_ROOT/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin:$PATH
    ./Configure android-arm64 -D__ANDROID_API__=34 # if you need to, here you can change the API verson
    make
    cd ..
  6. Run cmake using the toolchain file
    mkdir build
    cd build
    cmake -DCMAKE_TOOLCHAIN_FILE=../android-toolchain.cmake ..
  7. Start the build and hope for the best
    cmake --build .

Languages

  • C 98.4%
  • Other 1.6%