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)
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>

1  2 
lib/egl.nit
src/ffi/c.nit
src/platform/android.nit

diff --cc lib/egl.nit
Simple merge
diff --cc src/ffi/c.nit
Simple merge
Simple merge