androidcmakeandroid-ndkndk-build

cmake equivalent of ndk-build's NDK_DEBUG=1


When I build module with ndk-build, and I want to build it in debug mode, then I know what to do. But currently cmake is recommended tool for building modules - what is equivalent of NDK_DEBUG=1 for building android module with cmake?


Solution

  • I have found documentation on official site: below Reference table 1 is tooltip (https://developer.android.com/ndk/guides/ndk-build#dvr):

    Note: NDK_DEBUG=0 is the equivalent of APP_OPTIM=release, and compiles with -O2. 
    NDK_DEBUG=1 is the equivalent of APP_OPTIM=debug in Application.mk, 
    and compiles with -O0. For more information about APP_OPTIM, see Application.mk.