Skip to content

Commit

Permalink
Merge pull request #1287 from glotzerlab/cmake-color
Browse files Browse the repository at this point in the history
Enable cmake color output for clang/ninja
  • Loading branch information
joaander authored Oct 28, 2024
2 parents fea5357 + 9f47d65 commit d0850af
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ if(WIN32)
add_compile_options(/DNOMINMAX)
endif()

# Enable diagnostic colors for ninja
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always")
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcolor-diagnostics")
endif()

include_directories(
${PROJECT_SOURCE_DIR}/cpp/util ${PROJECT_SOURCE_DIR}/cpp/locality
${PROJECT_SOURCE_DIR}/cpp/box)
Expand Down
6 changes: 6 additions & 0 deletions doc/source/reference/credits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,12 @@ Philipp Schönhöfer

* Contributed code, design, documentation, and testing for ``freud.locality.FilterRAD`` class.


Jen Bradley

* Updated CMake to color error messages for build systems that buffer output.


Source code
-----------

Expand Down

0 comments on commit d0850af

Please sign in to comment.