在Application.mk中,您可以设置:
APP_OPTIM := release
APP_OPTIM := debug
Run Code Online (Sandbox Code Playgroud)
如何在C++中测试发布/调试版本?
我假设有定义所以我试过这个,但只记录"NOT"消息:
#ifdef RELEASE
LOGV("RELEASE");
#else
LOGV("NOT RELEASE");
#endif
#ifdef DEBUG
LOGV("DEBUG");
#else
LOGV("NOT DEBUG");
#endif
Run Code Online (Sandbox Code Playgroud)
Ale*_*ohn 24
在android-ndk-r8b/build/core/add-application.mk我们读到:
ifeq ($(APP_OPTIM),debug)
APP_CFLAGS := -O0 -g $(APP_CFLAGS)
else
APP_CFLAGS := -O2 -DNDEBUG -g $(APP_CFLAGS)
endif
Run Code Online (Sandbox Code Playgroud)
所以,回答你的问题:在NDK r8b(今天的最新版本)中你可以查看
#ifdef NDEBUG
// this is "release"
#else
// this is "debug"
#endif
Run Code Online (Sandbox Code Playgroud)
但是,如果需要,您可以通过您的Android.mk或Application.mk依赖于$(APP_OPTIM)添加任何其他编译标志.
| 归档时间: |
|
| 查看次数: |
7294 次 |
| 最近记录: |