Commit c6fa7246 authored by Rafael Kitover's avatar Rafael Kitover
Browse files

cmake: use color gcc/clang output when possible

Test for the -fdiagnostics-color=auto compiler option supported by gcc
and probably clang, and turn it on if it's available.

This option colorizes compiler warnings/errors/etc. when output to a
terminal.

Also fix a typo above when adding the -fopenmp flag.
parent e912c359
...@@ -438,7 +438,13 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL Clang) ...@@ -438,7 +438,13 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
endif() endif()
endif() endif()
set(MYU_C_FLAGS ${MY_C_FLAGS} -fopenmp)
set(MY_C_FLAGS ${MY_C_FLAGS} -fopenmp)
endif()
check_cxx_compiler_flag(-fdiagnostics-color=auto COMPILER_COLOR_OUTPUT)
if(COMPILER_COLOR_OUTPUT)
add_compile_options(-fdiagnostics-color=auto)
endif() endif()
if(MINGW) if(MINGW)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment