diff --git a/scripts/cmake/CompilerSetup.cmake b/scripts/cmake/CompilerSetup.cmake index ba7381a96163769eee32628b8042090a38b64100..641699222ff14ab79967ec24667c58f4f4c3d916 100644 --- a/scripts/cmake/CompilerSetup.cmake +++ b/scripts/cmake/CompilerSetup.cmake @@ -54,6 +54,16 @@ if(COMPILER_IS_GCC OR COMPILER_IS_CLANG OR COMPILER_IS_INTEL) -Wextra ) + # Coloring output + option (FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." ON) + if (${FORCE_COLORED_OUTPUT}) + if (COMPILER_IS_GCC) + add_compile_options (-fdiagnostics-color=always) + elseif (COMPILER_IS_CLANG) + add_compile_options (-fcolor-diagnostics) + endif () + endif() + # Profiling if(OGS_PROFILE) if(NOT CMAKE_BUILD_TYPE STREQUAL "Release")