提交 4f80078e 编写于 作者: B Bruce Mitchener 提交者: Ebrahim Byagowi

[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.
上级 5ed26fc5
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册