fix: only enable -Werror and other flags for debug builds only

This commit is contained in:
Curve 2022-04-04 23:40:53 +02:00
parent a4fc381177
commit 942d78cd4d
No known key found for this signature in database
GPG Key ID: 460F6C466BD35813

View File

@ -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)