Pavel P
Pavel P

Reputation: 16843

android ndk build: global cflags (or any other params)

Is there some variable that I can set in environment, so that all ndk-builds would inherit these flags?

For example:

set GLOBAL_CFLAGS=-DXXXXXXX=1234
ndk-build V=1 ...
...

here I should see that -DXXXXXXX=1234 was passed to gcc.

Upvotes: 1

Views: 3690

Answers (1)

Alex Cohn
Alex Cohn

Reputation: 57173

Try APP_CFLAGS. Be careful, though, because if your project relies on custom Application.mk to set application-specific CFLAGS, your environment variable setting will obscure this.

Update: note that NDK will override the environment variable (Windows or Unix); you must specify the flag on command line, e.g.

ndk-build APP_CFLAGS=-DXXXXXXX=1234

Upvotes: 3

Related Questions