Enable colored diagnostics also for Ninja, also for GCC:
Ninja buffers compiler output, and compilers then think they should not use colored output (because no terminal). Force it on them. The same was already implemented for clang, a few lines above. And let cling survive: it's parsing compiler output, and the ANSI color escapes confuse the regexes.
This commit is contained in:
@ -129,7 +129,6 @@ if (UNIX)
|
|||||||
# Remove absolute path from CMAKE_CXX_COMPILER
|
# Remove absolute path from CMAKE_CXX_COMPILER
|
||||||
get_filename_component(_name ${CMAKE_CXX_COMPILER} NAME)
|
get_filename_component(_name ${CMAKE_CXX_COMPILER} NAME)
|
||||||
get_filename_component(_path ${CMAKE_CXX_COMPILER} PATH)
|
get_filename_component(_path ${CMAKE_CXX_COMPILER} PATH)
|
||||||
|
|
||||||
# This should probably be more general...but how?
|
# This should probably be more general...but how?
|
||||||
if(_name STREQUAL "ccache" OR _name STREQUAL "distcc")
|
if(_name STREQUAL "ccache" OR _name STREQUAL "distcc")
|
||||||
separate_arguments(_arg_list UNIX_COMMAND "${CMAKE_CXX_COMPILER_ARG1}")
|
separate_arguments(_arg_list UNIX_COMMAND "${CMAKE_CXX_COMPILER_ARG1}")
|
||||||
@ -249,7 +248,9 @@ if (UNIX)
|
|||||||
set(CLING_CXX_PATH "${CLING_CXX_PATH} ${CLING_CXX_PATH_ARGS}")
|
set(CLING_CXX_PATH "${CLING_CXX_PATH} ${CLING_CXX_PATH_ARGS}")
|
||||||
else()
|
else()
|
||||||
# convert CMAKE_CXX_FLAGS to a list for execute_process
|
# convert CMAKE_CXX_FLAGS to a list for execute_process
|
||||||
string(REPLACE " " ";" cling_tmp_arg_list ${CMAKE_CXX_FLAGS})
|
string(REPLACE "-fdiagnostics-color=always" "" cling_tmp_arg_list ${CMAKE_CXX_FLAGS})
|
||||||
|
string(REPLACE "-fcolor-diagnosics" "" cling_tmp_arg_list ${cling_tmp_arg_list})
|
||||||
|
string(REPLACE " " ";" cling_tmp_arg_list ${cling_tmp_arg_list})
|
||||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} ${cling_tmp_arg_list} -xc++ -E -v /dev/null
|
execute_process(COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} ${cling_tmp_arg_list} -xc++ -E -v /dev/null
|
||||||
OUTPUT_QUIET ERROR_VARIABLE CLING_CXX_HEADERS)
|
OUTPUT_QUIET ERROR_VARIABLE CLING_CXX_HEADERS)
|
||||||
endif()
|
endif()
|
||||||
|
Reference in New Issue
Block a user