Add some missing compiler checks to the main CMakeLists.txt

This commit is contained in:
Gary Talent 2018-03-09 21:46:47 -06:00
parent 493060955b
commit 56ed98268f

View File

@ -17,11 +17,18 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
)
else()
add_definitions(
-Werror
-DNDEBUG
-Werror
)
endif()
if(NOT MSVC)
add_definitions(
-Wall
-Wsign-compare
)
if(NOSTALGIA_BUILD_TYPE STREQUAL "GBA")
include(GBA)
add_definitions(
@ -34,17 +41,24 @@ if(NOSTALGIA_BUILD_TYPE STREQUAL "GBA")
)
endif()
if (CMAKE_BUILD_TYPE STREQUAL "Release")
add_definitions(
-Werror
-O3
)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_definitions(
-fdiagnostics-color # forces colored output when using ninja
)
endif()
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
add_definitions(
#-fdiagnostics-color # forces colored output when using ninja
-Wall
-Wsign-compare
)
if(NOSTALGIA_IDE_BUILD STREQUAL "ON")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
@ -70,12 +84,6 @@ else()
set(NOSTALGIA_DIST_RESOURCES share)
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Release")
add_definitions(
-Werror
)
endif()
enable_testing()
add_subdirectory(deps/ox)