Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Neutree/c_cpp_project_framework
Browse files Browse the repository at this point in the history
  • Loading branch information
Neutree committed Mar 31, 2024
2 parents f06db8c + 694ca6b commit 4354270
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion examples/demo1/main/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion tools/cmake/compile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -403,10 +403,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
Expand Down

0 comments on commit 4354270

Please sign in to comment.