Thanks, we have linked your license to your forum account.
We have rechecked the DEBUG/RELEASE flags for CMake projects and indeed they got broken when we added an option to select between size and speed optimization.
We have fixed it on our side and will include it in the next Beta. As a workaround until then, you can simply patch the C:\Program Files (x86)\Sysprogs\VisualGDB\CMake\embedded\root.cmake file as shown below:
if("${VISUALGDB_TOOLCHAIN_SUBTYPE}" STREQUAL "GCC")
- set(CMAKE_C_FLAGS_DEBUG "-g3 -O0")
+ set(CMAKE_C_FLAGS_DEBUG "-g3 -O0 -DDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
#Add "OPTIMIZE_FOR_SIZE=1" to Extra CMake Configuration Variables in VisualGDB Project Properties in order to optimize the release build for size, rather than speed.
if(OPTIMIZE_FOR_SIZE)
- set(CMAKE_C_FLAGS_RELEASE "-g3 -Os")
+ set(CMAKE_C_FLAGS_RELEASE "-g3 -Os -DRELEASE")
else()
- set(CMAKE_C_FLAGS_RELEASE "-g3 -O3")
+ set(CMAKE_C_FLAGS_RELEASE "-g3 -O3 -DRELEASE")
endif()