-
Notifications
You must be signed in to change notification settings - Fork 1
Build instructions for Android
ameci-iis edited this page Apr 4, 2024
·
1 revision
You need to have CMake and the Android NDK installed.
- Clone the project and make a build folder.
$ git clone git@github.com:Fraunhofer-IIS/iec61937-13.git $ mkdir -p build_android - Configure the project using CMake.
Use a toolchain file and set the path to it correctly.
$ cmake -S iec61937-13 -B build_android -DCMAKE_TOOLCHAIN_FILE=<ndk_path>/build/cmake/android.toolchain.cmake -DCMAKE_BUILD_TYPE=Release - Build the project.
The build/ folder should, dependent on the set configuration, now contain:
$ cmake --build build_android- lib/ subfolder with the built project libraries
- bin/ subfolder with the built project binaries (e.g. example programs)
- doc/ subfolder with the generated Doxygen documentation
The parameter CMAKE_TOOLCHAIN_FILE is added in step 2 of the build instructions above and should point to a file containing a toolchain description. You can find more information on that topic here.
We do not provide any toolchain files for Android builds, as the Android NDK ships with its own cross-compilation toolchain and toolchain file. It is located in <ndk_path>/build/cmake/android.toolchain.cmake, where <ndk_path> is the install location of the Android NDK. The build configuration can be further controlled by setting the cache variables ANDROID_PLATFORM, ANDROID_ABI and ANDROID_STL using the -D option.