From 4682fa372bda59c0800a4becdcb9c344f8fadaeb Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 10 Oct 2022 17:37:06 +0200 Subject: [PATCH] Updated Working for Android (markdown) --- Working-for-Android.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Working-for-Android.md b/Working-for-Android.md index 1acb627..4d8bc46 100644 --- a/Working-for-Android.md +++ b/Working-for-Android.md @@ -78,6 +78,26 @@ endif ``` +**WARNING: If compiled project is developed in C++ instead of C, there are additional considerations:** + +To compile the game into a shared library (`libmain.so`) the following flags are required: + +- Compile C with `clang`: `-std=c99 -lc` +- Compile C++ with `clang++`: `-std=c++11 -lc++` + +Add required shared libraries to the generated APK: + +- Compiling in C: +``` + $BUILD_TOOLS/aapt add $__OUTP/$NAME.apk lib/$ABI/libmain.so +``` +- Compiling in C++: +``` + cp $TOOLCHAIN/../../../../sources/cxx-stl/llvm-libc++/libs/$ABI/libc++_shared.so lib/$ABI/libc++_shared.so + $BUILD_TOOLS/aapt add $__OUTP/$NAME.apk lib/$ABI/libc++_shared.so + $BUILD_TOOLS/aapt add $__OUTP/$NAME.apk lib/$ABI/libmain.so +``` + _Step 2:_ To install the APK into connected device (previously intalled drivers and activated USB debug mode on device): %ANDROID_SDK_TOOLS%\adb install simple_game.apk