File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ option(R_LIB "Build shared library for R package" OFF)
32
32
## Dev
33
33
option (USE_DEBUG_OUTPUT "Dump internal training results like gradients and predictions to stdout.
34
34
Should only be used for debugging." OFF )
35
+ option (FORCE_COLORED_OUTPUT "Force colored output from compilers, useful when ninja is used instead of make." OFF )
35
36
option (ENABLE_ALL_WARNINGS "Enable all compiler warnings. Only effective for GCC/Clang" OFF )
36
37
option (GOOGLE_TEST "Build google tests" OFF )
37
38
option (USE_DMLC_GTEST "Use google tests bundled with dmlc-core submodule" OFF )
@@ -107,6 +108,12 @@ if (USE_CUDA)
107
108
message (STATUS "CUDA GEN_CODE: ${GEN_CODE} " )
108
109
endif (USE_CUDA )
109
110
111
+ if (FORCE_COLORED_OUTPUT AND (CMAKE_GENERATOR STREQUAL "Ninja" ) AND
112
+ ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ) OR
113
+ (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )))
114
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always" )
115
+ endif ()
116
+
110
117
find_package (Threads REQUIRED )
111
118
112
119
if (USE_OPENMP )
You can’t perform that action at this time.
0 commit comments