libgdx/libgdx — pull request #29 by ksclarke (2012-09-07 05:17:03+00:00)
Title: Changed native lib build files to skip a build if the necessary compiler was missing

The native libraries have their own build.xml files for each platform (Windows 64, Windows 32, Linux 32, etc.) When I tried to run the native lib build using:

ant -Denv.NDK_HOME=/opt/android-ndk-r8b -Dbuild-natives=true

the build failed when it reached a compiler I didn't have available/configured to cross-compile on my machine.

What I decided to do was to change all the native lib build files to check for the existence of the compiler (i586-mingw32msvc-gcc, etc.) and to skip that particular part of the build if it couldn't find that compiler on the system. This shouldn't cause problems for systems that have a compiler configured, but should just avoid unnecessary failures when trying to build for only a particular platform. It seems like a good idea to me, but I'm completely new to libgdx (just finding my way) so may be missing some particular nuance of the build. Fwiw, thought I'd pass it back upstream for review.

I also made some minor formatting tweaks in the build files' XML (removed unusual formatting in the XML just out of habit -- sorry that pollutes the patch a bit). Overall, it's the same pattern applied to each of the native/jni build files.