Improve things a little for Linux.

This commit is contained in:
Mark Rowe 2016-01-06 17:23:11 -08:00
parent 548701c2fd
commit fbb386a735
2 changed files with 9 additions and 4 deletions

View File

@ -4,7 +4,12 @@ set(CMAKE_CXX_EXTENSIONS off)
set(CMAKE_BUILD_TYPE CACHE STRING Debug)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" AND ${CMAKE_GENERATOR} STREQUAL "Ninja")
if(${CMAKE_GENERATOR} STREQUAL "Ninja")
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcolor-diagnostics")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
endif()
endif()

View File

@ -1,6 +1,6 @@
project(realm-object-store)
cmake_minimum_required(VERSION 3.4.0)
cmake_minimum_required(VERSION 3.2.0)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
include(CompilerFlags)