From 9c43634190ab2936519721b3dcb642b5a2af787b Mon Sep 17 00:00:00 2001 From: Strahinja Val Markovic Date: Sun, 17 Nov 2013 11:23:16 -0800 Subject: [PATCH] Force clang color output when building with Ninja --- cpp/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 5dbc4a2d..5b6d1941 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -71,6 +71,12 @@ if ( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" ) if ( NOT DEFINED ENV{TRAVIS} ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" ) endif() + + # Ninja will by default prevent Clang from outputting diagnostics in color, so + # we force color output + if ( CMAKE_GENERATOR STREQUAL "Ninja" ) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics" ) + endif() endif() #############################################################################