mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 11:06:18 +00:00
cmake: option for forcing coloured compiler output
This commit is contained in:
parent
140e4a04b5
commit
960e68a976
|
@ -322,6 +322,17 @@ if(CMAKE_INTERPROCEDURAL_OPTIMIZATION)
|
||||||
message(STATUS "Inter-procedural optimization enabled")
|
message(STATUS "Inter-procedural optimization enabled")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Make sure we have pretty colours
|
||||||
|
option (FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." FALSE)
|
||||||
|
|
||||||
|
if ("${FORCE_COLORED_OUTPUT}")
|
||||||
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
|
||||||
|
add_compile_options (-fdiagnostics-color=always)
|
||||||
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
|
add_compile_options (-fcolor-diagnostics)
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
|
||||||
###
|
###
|
||||||
# Decend into madness.
|
# Decend into madness.
|
||||||
###
|
###
|
||||||
|
|
Loading…
Reference in a new issue