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,12 +17,19 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug")
) )
else() else()
add_definitions( add_definitions(
-Werror
-DNDEBUG -DNDEBUG
-Werror
) )
endif() endif()
if(NOSTALGIA_BUILD_TYPE STREQUAL "GBA") if(NOT MSVC)
add_definitions(
-Wall
-Wsign-compare
)
if(NOSTALGIA_BUILD_TYPE STREQUAL "GBA")
include(GBA) include(GBA)
add_definitions( add_definitions(
-nostdlib -nostdlib
@ -32,19 +39,26 @@ if(NOSTALGIA_BUILD_TYPE STREQUAL "GBA")
-mthumb-interwork -mthumb-interwork
-mthumb -mthumb
) )
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() endif()
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)
add_definitions(
#-fdiagnostics-color # forces colored output when using ninja
-Wall
-Wsign-compare
)
if(NOSTALGIA_IDE_BUILD STREQUAL "ON") if(NOSTALGIA_IDE_BUILD STREQUAL "ON")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
@ -70,12 +84,6 @@ else()
set(NOSTALGIA_DIST_RESOURCES share) set(NOSTALGIA_DIST_RESOURCES share)
endif() endif()
if(CMAKE_BUILD_TYPE STREQUAL "Release")
add_definitions(
-Werror
)
endif()
enable_testing() enable_testing()
add_subdirectory(deps/ox) add_subdirectory(deps/ox)