Force colored output for ninja build. (#5959)
This commit is contained in:
parent
d268a2a463
commit
70903c872f
@ -32,6 +32,7 @@ option(R_LIB "Build shared library for R package" OFF)
|
|||||||
## Dev
|
## Dev
|
||||||
option(USE_DEBUG_OUTPUT "Dump internal training results like gradients and predictions to stdout.
|
option(USE_DEBUG_OUTPUT "Dump internal training results like gradients and predictions to stdout.
|
||||||
Should only be used for debugging." OFF)
|
Should only be used for debugging." OFF)
|
||||||
|
option(FORCE_COLORED_OUTPUT "Force colored output from compilers, useful when ninja is used instead of make." OFF)
|
||||||
option(ENABLE_ALL_WARNINGS "Enable all compiler warnings. Only effective for GCC/Clang" OFF)
|
option(ENABLE_ALL_WARNINGS "Enable all compiler warnings. Only effective for GCC/Clang" OFF)
|
||||||
option(GOOGLE_TEST "Build google tests" OFF)
|
option(GOOGLE_TEST "Build google tests" OFF)
|
||||||
option(USE_DMLC_GTEST "Use google tests bundled with dmlc-core submodule" OFF)
|
option(USE_DMLC_GTEST "Use google tests bundled with dmlc-core submodule" OFF)
|
||||||
@ -107,6 +108,12 @@ if (USE_CUDA)
|
|||||||
message(STATUS "CUDA GEN_CODE: ${GEN_CODE}")
|
message(STATUS "CUDA GEN_CODE: ${GEN_CODE}")
|
||||||
endif (USE_CUDA)
|
endif (USE_CUDA)
|
||||||
|
|
||||||
|
if (FORCE_COLORED_OUTPUT AND (CMAKE_GENERATOR STREQUAL "Ninja") AND
|
||||||
|
((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR
|
||||||
|
(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")))
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
|
||||||
|
endif()
|
||||||
|
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
|
|
||||||
if (USE_OPENMP)
|
if (USE_OPENMP)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user