Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道我是否可以在 Android.bp 文件中定义 C 语言宏?我将一些模块(用 C++ 编写)的单元测试包装到 VTS 框架中。有一些变化需要在宏下加以保护。
您可以cflags在Android.bp要检查的测试代码中添加定义。
cflags
Android.bp
cc_binary { [...] cflags: [ "-DMYUNITTEST" ] }
#ifndef MYUNITTEST // not to be used in this unittest. #endif