From: Bruce Mitchener Date: Thu, 4 Jan 2018 11:37:35 +0000 (+0700) Subject: [cmake] Colorize output when using cmake + ninja. (#674) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f80078eb035054db0f6e33cf4f7345c6c85cb12;p=platform%2Fupstream%2FlibHarfBuzzSharp.git [cmake] Colorize output when using cmake + ninja. (#674) Due to how ninja runs clang and gcc, it doesn't colorize the output like make does. This forces color output in this situation. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fdcebd..4b713b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -699,6 +699,16 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) endif () endif () +if (UNIX AND CMAKE_GENERATOR STREQUAL "Ninja") + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set (CMAKE_CXX_FLAGS "-fcolor-diagnostics ${CMAKE_CXX_FLAGS}") + set (CMAKE_C_FLAGS "-fcolor-diagnostics ${CMAKE_C_FLAGS}") + endif () + if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set (CMAKE_CXX_FLAGS "-fdiagnostics-color ${CMAKE_CXX_FLAGS}") + set (CMAKE_C_FLAGS "-fdiagnostics-color ${CMAKE_C_FLAGS}") + endif () +endif () ## Tests if (UNIX)