3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-07 09:55:19 +00:00

Merge pull request #1519 from waywardmonkeys/colorize-output-with-ninja

Force color output with Ninja.
This commit is contained in:
Nikolaj Bjorner 2018-03-09 05:18:50 -05:00 committed by GitHub
commit 4e31794c44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -409,6 +409,20 @@ list(APPEND Z3_DEPENDENT_LIBS ${CMAKE_THREAD_LIBS_INIT})
################################################################################ ################################################################################
include(${CMAKE_SOURCE_DIR}/cmake/compiler_warnings.cmake) include(${CMAKE_SOURCE_DIR}/cmake/compiler_warnings.cmake)
################################################################################
# If using Ninja, force color output for Clang and gcc.
################################################################################
if (UNIX AND CMAKE_GENERATOR STREQUAL "Ninja")
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcolor-diagnostics")
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color")
endif()
endif()
################################################################################ ################################################################################
# Option to control what type of library we build # Option to control what type of library we build
################################################################################ ################################################################################