Continuing from the 'GTK3 proposal' thread, another baby step taken! I've now gotten my littlest demo to run on Android, on emulator and phone. Emulator screenshot attached.
Some notes:
- Android Studio uses Gradle as its build system. For 'native' projects, Gradle calls CMake. I can't quite get CMake to run FPC cross compiler from within Android Studio yet. So I build the Pascal shared library using shell script, then have CMake incorporate the shared library into the final artefact.
- For 32-bit ARM, the Gnu binutils cross linker is not able to produce the Pascal shared library:
Assembling dwindows
Assembling dwprunner
Linking armeabi-v7a/libdwprunner.so
/home/pierce/pkg/cross/arm-linux-androideabi/bin/arm-linux-androideabi-ld.bfd: error:
source object /home/pierce/pkg/android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/arm-linux-androideabi/29/crtbegin_so.o
has EABI version 5, but target armeabi-v7a/libdwprunner.so has EABI version 0
But:
% file *.o
dwindows.o: ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV), not stripped
dwprunner.o: ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV), not stripped
So I have no idea what's happening here.
I'll look into iOS next.
Edit: iOS thread here:
https://forum.lazarus.freepascal.org/index.php/topic,61621.0.html