Merge: ldflags for Android
authorJean Privat <jean@pryen.org>
Thu, 29 Jan 2015 11:59:01 +0000 (18:59 +0700)
committerJean Privat <jean@pryen.org>
Thu, 29 Jan 2015 11:59:01 +0000 (18:59 +0700)
commit1772b949316cb3878b6717bf3a7ed2f419ba1c0f
treede1eb02a55e89a29df11935918eedc6b03ae977e
parentfac640cbcd6ed13bce5bbf96f59fa8bebe19530a
parentfb42029128afad39f9bb02f7641a601c2db7c69f
Merge: ldflags for Android

For the same module, cflags and ldflags can vary per platform. This new annotation on annotations targets a platform for each cflags or ldflags. By default, the target platform is that of the host. It will probably need to be clarified on more modules once we support more platforms.

It will be used to load (or not load) OpenGL ES v1.0 vs 2.0 and libandroid in future PR. For now, only `calculator` should save on linking with OpenGL.

I hesitated between different annotations before settling on `@android`:
* `@target(android)` makes it clear that it is the target, but it gets a bit heavy to read: `module android_opengles1 is ldflags("-lEGL -lGLESv1_CM")@target(android)`
* `@only(android)` makes it clear that only Android is affected by this annotation.
* but `@android` is easy to read and clear enough to fit with an already complex syntax.

TODO `cflags@android` declarations are accepted but unused at this time.

Pull-Request: #1124
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
lib/egl.nit
src/ffi/c.nit
src/platform/android.nit