From fbb386a7352f293f2eb1541a9e914e32919edbe3 Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Wed, 6 Jan 2016 17:23:11 -0800 Subject: [PATCH] Improve things a little for Linux. --- CMake/CompilerFlags.cmake | 11 ++++++++--- CMakeLists.txt | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CMake/CompilerFlags.cmake b/CMake/CompilerFlags.cmake index a5a6bd36..25d78a77 100644 --- a/CMake/CompilerFlags.cmake +++ b/CMake/CompilerFlags.cmake @@ -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") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcolor-diagnostics") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics") +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() diff --git a/CMakeLists.txt b/CMakeLists.txt index ee79aa5a..85138132 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)