android-pbc

git clone git://git.codymlewis.com/android-pbc.git
Log | Files | Refs | README

README.md (1359B)


      1 # PBC for Android
      2 PBC pre-built for the android platform
      3 
      4 ## Using this
      5 Add this repository as submodule to your program with something like the
      6 following:
      7 ```sh
      8 git submodule add git://github.com/codymlewis/android-pbc.git app/src/main/cpp/pbc
      9 ```
     10 
     11 then add the following in your cmake file somewhere after the
     12 `cmake_minimum_required` line:
     13 ```cmake
     14 add_library(pbc SHARED IMPORTED)
     15 set_target_properties(pbc PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/pbc/${ANDROID_ABI}/libpbc.so)
     16 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/pbc/include/)
     17 ```
     18 
     19 and add `pbc` to your `target_link_libraries` in the same cmake file, for
     20 example:
     21 ```cmake
     22 target_link_libraries(native-lib pbc ${log-lib})
     23 ```
     24 
     25 ## How-to: Build your own version
     26 ### Requirements
     27 - Android SDK
     28 - Android NDK
     29 You must also set the `ANDROID_NDK_ROOT` variable to the location of the root of
     30 you ndk folder and set `ANDROIDAPI` the integer version of the api you are
     31 using.
     32 
     33 You will also want a copy of the [GMP](https://gmplib.org) library built for android, for example,
     34 through cloning with the following:
     35 ```sh
     36 git clone https://github.com/Rupan/gmp.git
     37 ```
     38 
     39 ### Building
     40 Get pbc and move into the directory:
     41 ```sh
     42 git clone https://github.com/blynn/pbc
     43 cd pbc
     44 ```
     45 
     46 Now run a compiling script, you may need to modify it for your setup:
     47 ```sh
     48 ../build-scripts/compile-all
     49 ```