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.
This commit is contained in:
parent
e912c359f6
commit
c6fa7246de
|
@ -438,7 +438,13 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
|||
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()
|
||||
|
||||
if(MINGW)
|
||||
|
|
Loading…
Reference in New Issue