diff --git a/examples/demo1/main/src/main.c b/examples/demo1/main/src/main.c index 83ad273..182b1ca 100644 --- a/examples/demo1/main/src/main.c +++ b/examples/demo1/main/src/main.c @@ -21,7 +21,11 @@ int main() { - printf("hello\n"); +#if DEBUG + printf("!!! DEBUG !!!\n"); +#elif RELEASE + printf("!!! RELEASE !!!\n"); +#endif test(); test1(); #if CONFIG_COMPONENT2_ENABLED diff --git a/tools/cmake/compile.cmake b/tools/cmake/compile.cmake index 13b68f3..fc3d1ae 100644 --- a/tools/cmake/compile.cmake +++ b/tools/cmake/compile.cmake @@ -380,10 +380,12 @@ macro(project name) endif() # add DEBUG or RELEASE flag globally - if(CMAKE_BUILD_TYPE STREQUAL "Debug") + if(NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "Debug") add_definitions(-DDEBUG=1 -DRELEASE=0) + # message("!!! DEBUG !!!") else() add_definitions(-DRELEASE=1 -DDEBUG=0) + # message("!!! RELEASE !!!") endif() # Add dependence: update configfile, append time and git info for global config header file