Skip to content

Commit

Permalink
Allow to force-override color diagnostics
Browse files Browse the repository at this point in the history
Change-Id: I7c19651df6d74753b0d4e8ac85ff98326dee7b10
Reviewed-on: http://gerrit.cloudera.org:8080/3509
Reviewed-by: Adar Dembo <[email protected]>
Tested-by: Mike Percy <[email protected]>
  • Loading branch information
mpercy committed Jul 1, 2016
1 parent 88acae3 commit 3e39173
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,11 @@ if ("${COMPILER_FAMILY}" STREQUAL "clang")
#
# This test is imperfect because 'cmake' and 'make' can be run independently
# (with different terminal options), and we're testing during the former.
#
# We also provide a manual override as -DKUDU_FORCE_COLOR_DIAGNOSTICS=1.
execute_process(COMMAND test -t 2 RESULT_VARIABLE KUDU_IS_TTY)
if ((${KUDU_IS_TTY} EQUAL 0) AND (NOT ("$ENV{TERM}" STREQUAL "dumb")))
if ((NOT "${KUDU_FORCE_COLOR_DIAGNOSTICS}" STREQUAL "") OR
((${KUDU_IS_TTY} EQUAL 0) AND (NOT ("$ENV{TERM}" STREQUAL "dumb"))))
message("Running in a controlling terminal")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
else()
Expand Down

0 comments on commit 3e39173

Please sign in to comment.