This repository is designed to provide tooling's to cross compile OCaml and ReasonML to Android and iOS. But it also should work for any platform including Linux and Windows.
warning, esy@0.6.10 actually matters
To compile the hello-reason project for android arm64:
## build for host
cd hello-reason
esy
## generate the wrapper
esy add -D generate@EduardoRFS/reason-mobile:generate.json
esy generate android.arm64
## build for android.arm64
esy @android.arm64
As most esy projects the binary will be available at #{self.target_dir}
esy @android.arm64 file "#{self.target_dir}/default.android.arm64/bin/hello.exe"
Currently a couple of big projects can be built with small or zero changes, esy
itself can also be built using this project, allowing it to run inside Android, iOS or any Linux box with a musl and static build.
Both android.arm64
and android.x86_64
are supposed to work out of box, as it has no dependency in the system and will download the toolchain from android.ndk
.
On macOS it requires the Xcode SDK, install Xcode for that.
On Linux it requires cctools-ports
installed globally and the SDK in the right path at /Applications
With that done, ios.arm64
and ios.simulator.x86_64
should work
For macOS you should follow this https://github.com/FiloSottile/homebrew-musl-cross
If you have aarch64-linux-musl-gcc
, linux.musl.arm64
should work
If you have x86_64-linux-musl-gcc
, linux.musl.x86_64
should work
For Linux both should work out of the box, as it will download the toolchain from https://musl.cc/
A package for esy that will automagically generate the needed assets to cross compile using esy.
A collection of patches designed to solve packages that aren't solved by the hacks implemented on the generate or are package specific, like the cstubs who cannot be generated in a cross compilation environment, we use the host ones to solve the problem.
An esy package, making the compiler + sysroot available to esy. Currently we target the following environments
OS | ARCH | ENV |
---|---|---|
Android | arm64 | 24 |
Android | x86_64 | 24 |
iOS | arm64 | 17.7.0 |
iOS.simulator | x86_64 | 17.7.0 |
Linux | arm64 | musl |
Linux | x86_64 | musl |
macOS | arm64 | 20.1.0 |