My Android project nearing beta
H. S. Teoh
hsteoh at quickfur.ath.cx
Tue Dec 17 23:18:33 UTC 2019
On Tue, Dec 17, 2019 at 10:28:32PM +0000, kinke via Digitalmars-d-announce wrote:
> LDC 1.19 final will probably come with a native Android/AArch64
> package. It's going to contain prebuilt Android/x86_64
> druntime/Phobos too, and the armv7a package will contain the i686
> libs; i.e., there'll be prebuilt libs for all 4 Android platforms. See
> https://github.com/ldc-developers/ldc/pull/3244; I'm just waiting for
> LLVM 9.0.1 final to be released (planned for Dec 19th).
> Instead of wrappers around ldc2 and dub, I'd prefer a little generic
> tool, something like ldc-build-runtime, which automates
> 1) downloading a prebuilt LDC package for a specified
> cross-compilation target,
> 2) extracting & renaming the libs,
> 3) extending ldc2.conf by an appropriate section
Yeah, this would be very helpful. I struggled a bit to get Windows
build working, for example, because I didn't know the exact pattern to
put in ldc2.conf at first. I tried various combinations that didn't work
until I accidentally landed upon "x86_64-.*-windows.msvc" (the Wiki page
was confusing; it's either outdated or incomplete, as I was trying
"i686-.*-windows.*" to no avail).
Having this automated would be Very Nice indeed.
> Step 3 includes selecting a C cross-linker for most targets and could
> be simplified to just specifying the NDK path for Android targets.
> Usage would be something like:
> $ ldc-add-target android-aarch64
> Enter path to Android NDK: /path/to/android-ndk-r20b
> $ ldc2 -mtriple=aarch64-linux-android ...
> $ ldc-add-target windows-x64
> $ dub --arch=x86_64-windows-msvc ...
This is awesome stuff. My current Android still uses Joakim's old guide
that involves manually specifying a lot of stuff like explicit linker
options, library and SDK paths, etc., on the command line. True, I only
had to do it once and thereafter just put it in the build script, but
having a standard automated scheme to abstract away such details would
make it a lot more pleasant to use.
LDC is quickly becoming my go-to D compiler esp. because of this ease of
targeting other platforms. With superior codegen and ability to
cross-compile to Windows, Android, etc., without needing VMs, dual-boot,
separate cross-compiler installation, or any of that hassle, I'm quickly
running out of reasons to use dmd anymore. LDC is awesome (and so is
the LDC team).
Two wrongs don't make a right; but three rights do make a left...
More information about the Digitalmars-d-announce