Vaibhav Kulkarni
Vaibhav Kulkarni

Reputation: 29

Is there a way to define C language macro in Android.bp file?

I want to know if I can define C language macro in Android.bp file ? I am wrapping unit tests of some modules (which are written in C++) into VTS framework. There are certain changes which needs to be protected under macro.

Upvotes: 0

Views: 1134

Answers (1)

Simpl
Simpl

Reputation: 2036

You could add a define to the cflags in your Android.bp to be checked in your test code.

cc_binary {
    [...]
    cflags: [ "-DMYUNITTEST" ]
}
#ifndef MYUNITTEST
// not to be used in this unittest.
#endif

Upvotes: 0

Related Questions