diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c7d04a..eee11a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,11 @@ if (WIN32) target_compile_options(soundux PRIVATE /W4) else() add_executable(soundux ${src}) - target_compile_options(soundux PRIVATE -Wall -Werror -Wextra -pedantic -Wno-unused-lambda-capture -Wno-gnu) + + if (CMAKE_BUILD_TYPE STREQUAL "Debug") + message(STATUS "Enabling warning and error flags for debug build") + target_compile_options(soundux PRIVATE -Wall -Werror -Wextra -pedantic -Wno-unused-lambda-capture -Wno-gnu) + endif() endif() target_compile_definitions(soundux PRIVATE SOUNDUX_VERSION="${FULL_VERSION_STRING}" WNCK_I_KNOW_THIS_IS_UNSTABLE=1)