Skip to content

Commit

Permalink
Merge pull request #5248 from ligfx/ninjadiagnosticscolor2
Browse files Browse the repository at this point in the history
CMake: turn on -fdiagnostics-color for Ninja builds
  • Loading branch information
degasus committed Apr 12, 2017
2 parents 29344cb + 5b82916 commit c074945
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,13 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_L
message(FATAL_ERROR "Dolphin requires at least GCC 5.0 (found ${CMAKE_CXX_COMPILER_VERSION})")
endif()

if(CMAKE_GENERATOR MATCHES "Ninja")
check_and_add_flag(DIAGNOSTICS_COLOR -fdiagnostics-color)
elseif(CMAKE_GENERATOR MATCHES "Visual Studio")
# Only MSBuild needs this, other generators will compile one file at a time
add_compile_options("/MP")
endif()

if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
check_and_add_flag(EXCEPTIONS /EHsc)
dolphin_compile_definitions(_DEBUG DEBUG_ONLY)
Expand All @@ -216,11 +223,6 @@ if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
string(APPEND CMAKE_EXE_LINKER_FLAGS " /BASE:0x00400000")
string(APPEND CMAKE_EXE_LINKER_FLAGS " /DYNAMICBASE:NO")
string(APPEND CMAKE_EXE_LINKER_FLAGS " /FIXED")

# Only MSBuild needs this, other generators will compile one file at a time
if(CMAKE_GENERATOR MATCHES "Visual Studio")
add_compile_options("/MP")
endif()
else()
add_definitions(-D_DEFAULT_SOURCE)
check_and_add_flag(HAVE_WALL -Wall)
Expand Down

0 comments on commit c074945

Please sign in to comment.