Fix Android build (#886)
This commit is contained in:
+2
@@ -78,11 +78,13 @@ internal open class AndroidPlatform(distribution: Distribution)
|
||||
= binaries.filter { it.isUnixStaticLib }
|
||||
|
||||
override fun linkCommand(objectFiles: List<ObjectFile>, executable: ExecutableFile, optimize: Boolean, debug: Boolean): List<String> {
|
||||
// liblog.so must be linked in, as we use its functionality in runtime.
|
||||
return mutableListOf(clang).apply{
|
||||
add("-o")
|
||||
add(executable)
|
||||
add("-fPIC")
|
||||
add("-shared")
|
||||
add("-llog")
|
||||
addAll(objectFiles)
|
||||
if (optimize) addAll(linkerOptimizationFlags)
|
||||
if (!debug) addAll(linkerDebugFlags)
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
This example shows how to build an Android Native Activity.
|
||||
|
||||
The example will render a textured dodecahedron using OpenGL ES library. It can be rotated with fingers.
|
||||
Please make sure that Android SDK version 25 is installed, using Android SDK manager.
|
||||
Please make sure that Android SDK version 25 is installed, using Android SDK manager in Android Studio.
|
||||
See https://developer.android.com/studio/index.html for more details on Android Studio.
|
||||
|
||||
To build use `ANDROID_HOME=<your path to android sdk> ../gradlew buildApk`.
|
||||
|
||||
Run `$ANDROID_HOME/sdk/platform-tools/adb install -e build/outputs/apk/androidNativeActivity-arm-debug.apk`
|
||||
Run `$ANDROID_HOME/sdk/platform-tools/adb install -r build/outputs/apk/androidNativeActivity-arm-debug.apk`
|
||||
to deploy the apk on the Android device or emulator (note that only ARM-based devices are currently supported).
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// TODO: androidLauncher.h will become part of the platform library.
|
||||
headers = stdio.h stdlib.h string.h math.h time.h android/log.h androidLauncher.h EGL/egl.h GLES/gl.h
|
||||
linkerOpst = -landroid -lEGL -lGLESv1_CM -lz
|
||||
---
|
||||
|
||||
static int interop_errno() {
|
||||
|
||||
Reference in New Issue
Block a user