From cc89487125e23bccebd63e4077e63b57b6a70bbc Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Sat, 17 Feb 2018 21:54:04 +0100 Subject: Add all warning and thread them as errors --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 91774af..98b9ba1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,6 +24,15 @@ file(GLOB_RECURSE SOURCES RELATIVE ${CMAKE_SOURCE_DIR} "src/main/cpp/*.cpp") set(EXECUTABLE_NAME "subconscious") add_executable(${EXECUTABLE_NAME} ${SOURCES}) +# compiler settings +if (CMAKE_COMPILER_IS_GNUCC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror") +endif () + +if (MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") +endif () + # SFML library set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH}) find_package(SFML 2 REQUIRED network audio graphics window system) -- cgit v1.2.1