Skip to content

Commit 10088cd

Browse files
committed
Turn on warning as error only for Debug build
See #143: > This project is widely packaged in Linux distros. Some of those distros aggressively adopt new compiler versions and therefore will see build warnings that aren't yet seen in your environment. Close #143
1 parent 18fe942 commit 10088cd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,15 @@ endif()
7171

7272
# Use high warning levels
7373
if(MSVC)
74-
add_compile_options(/W4 /WX)
74+
add_compile_options(/W4)
75+
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
76+
add_compile_options(/WX)
77+
endif()
7578
else()
76-
add_compile_options(-Wall -Wextra -Wpedantic -Werror)
79+
add_compile_options(-Wall -Wextra -Wpedantic)
80+
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
81+
add_compile_options(-Werror)
82+
endif()
7783
endif()
7884

7985
add_subdirectory(lib)

0 commit comments

Comments
 (0)