diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a657148..6e6d0a41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,10 @@ endif() set(CMAKE_C_STANDARD 11) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DAMIGA -Wall -Wextra -fomit-frame-pointer") -set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DACE_DEBUG") +if(ACE_DEBUG) + # Add ACE debugging features to release build + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DACE_DEBUG") +endif() file(GLOB_RECURSE SOURCES src/*.c) file(GLOB HEADERS_ACE include/ace/*.h) file(GLOB HEADERS_ACE_GENERIC include/ace/generic/*.h) diff --git a/docs/programming/hello_world.md b/docs/programming/hello_world.md index 417c78d0..cdad4641 100644 --- a/docs/programming/hello_world.md +++ b/docs/programming/hello_world.md @@ -56,6 +56,13 @@ include_directories( ${PROJECT_SOURCE_DIR}/src ) +if(GAME_DEBUG) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DGAME_DEBUG") +endif() +if(ACE_DEBUG) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DACE_DEBUG") # For ACE headers with ifdefs +endif() + # ACE # If you cloned ACE into subdirectory, e.g. to `deps/ace` folder, use following: add_subdirectory(deps/ace ace)