Skip to content

Commit

Permalink
Do not enable -Werror by default. GCC is a pain constantly changing w…
Browse files Browse the repository at this point in the history
…arnings
  • Loading branch information
Godzil committed Apr 18, 2021
1 parent 8e62b1c commit 37589c7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/CMakeLists.txt
Expand Up @@ -19,12 +19,19 @@ set(USE_ALLEGRO ON CACHE BOOL "Use Allegro backend")

option(COVERALLS "Generate coveralls data" OFF)

option(WARN_AS_ERROR "Enable warning as error" OFF)

##########################
# Link & Compile flags
##########################

set(CMAKE_C_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-result -Werror ${PLATFORM_FLAGS}")
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-result -Werror ${PLATFORM_FLAGS}")
set(COMP_FLAGS "-march=native -Wall -Wextra -Wno-unused-parameter -Wno-unused-result -Wno-write-strings ${PLATFORM_FLAGS}")
if (WARN_AS_ERROR)
set(COMP_FLAGS "${COMP_FLAGS} -Werror")
endif()

set(CMAKE_C_FLAGS ${COMP_FLAGS})
set(CMAKE_CXX_FLAGS ${COMP_FLAGS})

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/external/coveralls-cmake/cmake)

Expand Down

0 comments on commit 37589c7

Please sign in to comment.