A modernization of gunroar so that it works with recent versions of its dependencies (OpenGL, SDL). Instead of the custom code originally used, the Derelict project is used instead.
Building this port requires a patched CMake with D support. The branch I am using is on my Github fork of CMake.
First, I have only tested the project with the Ninja generator which requires a branch of Ninja so that the dependencies generated by the compiler are understood by Ninja.
Personally, I use CMake-ified versions of the dependencies (use the cmake
branch of each repository):
DerelictUtil
DerelictSDL2
(requiresDerelictUtil
)DerelictGL3
(requiresDerelictUtil
)gl3n
Once these have been built (and ideally placed into a single root), gunroar may be built. You'll likely need to set the cache variables to the proper paths since the Find modules are not the most sophisticated.
As for compilers, I've been using the 2.064.2 release of gdc based on 4.8. The 2.065 release should work as well, but has not been extensively tested.
Currently, the binary must be run from the source directory (it is placed in
the bin
directory of the build tree). Patches which address this limitation
are welcome (and should support an installed version as well).
Building for Android requires building a patched NDK toolchain with GDC support. LDC support has not been attempted.
To build a custom toolchain, get a patched GDC (only 4.9 supported at the moment), the Android NDK (only r9d has been tested so far), and an NDK toolchain build environment.
Once the toolchain sources have been downloaded, patch the GCC using GDC's
setup-gcc.sh
script to patch Android's GCC 4.9 sources. Then edit the NDK's
build-gcc.sh
script to add --enable-languages=d
to the configure flags.
Currently, android-13
is the target for the Android build, so that should be
the targeted platform when building the toolchain.
One change that I've needed to make for D support is to change the ld
linker
to point to ld.bfd
instead of ld.gold
due to __data_start
being undefined
otherwise (it looks like a linker script is not executed when using ld.gold
,
but only with GDC; GCC is fine).
Once the toolchain is built, build all of the required Derelict libraries
(Util, SDL2, and GLES) configure a CMake build using a CMAKE_TOOLCHAIN_FILE
argument pointing to a CMake script setting the compiler, linker, archiver,
etc. just built above. An example file is provided in the repository as
src/android/toolchain.cmake
which just needs a few variables set. SDL and
SDL_mixer will be downloaded and built using the NDK.