Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Let .use files be version-aware, dammit! #561
So.. I've added stuff like
How about this instead?
The sdl2-opengl example is as hairy as it gets (imho), and we haven't even touched iOS yet.. but you get the idea.
I think with that we might be able to generate more robust Makefiles, flawless Android.mk, and even CMakeLists, who knows. And of course SequenceDriver will work splendidly on all platforms as well.
The current workaround is to have separate different .use files and hack OOC_LIBS to make rock find the right ones.. but that shouldn't be needed - the sdl2-opengl file above will actually be equivalent to these files, depending on your platform:
That will mean a lot more logic in the generate Makefiles though..
Android.mk is easy because there's only a single target. And the above conditions should translate pretty effortlessly in cmake's bastard scripting language. But for Makefile.. the really fun will begin :)
A few things to note:
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := sdl2 LOCAL_C_INCLUDES := $(LOCAL_PATH)/../sdk $(LOCAL_PATH)/../sdl2 $(LOCAL_PATH)/../gc/include $(LOCAL_PATH)/../SDL/include LOCAL_SRC_FILES := source/sdl2/Core.c source/sdl2/OpenGL.c source/sdl2/Event.c LOCAL_SHARED_LIBRARIES := gc gc SDL2 sdk LOCAL_LDLIBS := -lGLESv2 include $(BUILD_SHARED_LIBRARY)
It's the one for ooc-sdl2. The .use file has those android-specific flags:
This is actually very touchy because it depends on how you use SDL - have you cross-compiled it yourself, or do you use it as they say - ie. using their android project skeleton and having 'SDL' symlinked in your jni/ ? I do as they say so
Similarly, for libyaml, you could have:
That assumes you've cross-compiled libyaml yourself (for example with this Android cross-compile autotools script and following this piece of advice about autoreconf) and then installed it using jni/libyaml as your prefix.
So your android project tree looks something like this:
And if you're wondering, the way you'd generate that android stuff with rock is to launch this in your project directory:
So in that case,
Which works wonders. But it means we have to have some sort of consensus on how to name cross-compiled libraries.. Also at some point I wonder if having a repository of formulas (a-la homebrew/sam) on how to cross-compile libraries to Android to make it easier to use them. Or even provide compiled versions, you know, it's just a bunch of .h/.so/.a files after all.
I'm only rambling here, but it feels good to write about what I do :)