diff --git a/CMakeLists.txt b/CMakeLists.txt index 7da99146..8f492537 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,11 +20,16 @@ add_definitions( -fno-rtti #-g #-fcolor-diagnostics - -Werror #--analyze #-Os # GCC size optimization flag ) +if (CMAKE_BUILD_TYPE STREQUAL "Release") + add_definitions( + -Werror + ) +endif() + enable_testing() add_subdirectory(src) diff --git a/Makefile b/Makefile index a4f233e7..c0daaf31 100644 --- a/Makefile +++ b/Makefile @@ -62,3 +62,9 @@ gba: ${ENV_RUN} ./scripts/setup_build gba ${ENV_RUN} rm -f build/current ${ENV_RUN} ln -s gba-release build/current + +gba-debug: + ${ENV_RUN} rm -rf build/gba-debug + ${ENV_RUN} ./scripts/setup_build gba debug + ${ENV_RUN} rm -f build/current + ${ENV_RUN} ln -s gba-debug build/current diff --git a/build/Makefile b/build/Makefile index cbc2a4e5..60d82c58 100644 --- a/build/Makefile +++ b/build/Makefile @@ -1,4 +1,4 @@ -all: gba_build native_build native_debug_build windows_release windows_debug +all: gba_build gba_debug_build native_build native_debug_build windows_release windows_debug MAKE=make -j @@ -7,6 +7,11 @@ gba_build: ${MAKE} -C gba-release ${ARGS}; \ fi +gba_debug_build: + @if [ -d gba-debug ]; then \ + ${MAKE} -C gba-debug ${ARGS}; \ + fi + native_build: @if [ -d ${HOST_ENV}-release ]; then \ ${MAKE} -C ${HOST_ENV}-release ${ARGS}; \