Skip to content

Set up Meson for cross compilation

Joshua Goins requested to merge work/redstrate/cross-compile-meson into master

Previously Meson was not set up for cross compilation, so libraries that use Meson (like fribidi) breaks Android builds due to them compiling to the host architecture.

Meson uses a text file, similar to CMake, for selecting toolchain options for cross-compilation. Unlike CMake, the toolchain files are completely static so we generate one in /etc with the necessary constants set.

Tested on aarch64 (Android):

CRAFT:file /home/user/CraftRoot/lib/libfribidi.so.0.4.0 
/home/user/CraftRoot/lib/libfribidi.so.0.4.0: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, with debug_info, not stripped

Merge request reports