File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ option(INEXOR_BUILD_EXAMPLE "Build example" ON)
1717option (INEXOR_BUILD_TESTS "Build tests" OFF )
1818set (INEXOR_CONAN_PROFILE "default" CACHE STRING "conan profile" )
1919option (INEXOR_USE_VMA_RECORDING "Use VulkanMemoryAllocator recording feature" OFF )
20+ option (INEXOR_FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." TRUE )
2021
2122message (STATUS "INEXOR_BUILD_BENCHMARKS = ${INEXOR_BUILD_BENCHMARKS} " )
2223message (STATUS "INEXOR_BUILD_DOC = ${INEXOR_BUILD_DOC} " )
@@ -59,6 +60,16 @@ execute_process(
5960 OUTPUT_STRIP_TRAILING_WHITESPACE
6061)
6162
63+ # Enable GCC/clang ANSI-colored terminal output using Ninja build tool
64+ # TODO: Switch to `CMAKE_COLOR_DIAGNOSTICS` with cmake 3.24 in the future
65+ if (FORCE_COLORED_OUTPUT)
66+ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
67+ add_compile_options (-fdiagnostics-color=always)
68+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
69+ add_compile_options (-fcolor-diagnostics)
70+ endif ()
71+ endif ()
72+
6273add_subdirectory (shaders)
6374add_subdirectory (src)
6475
You can’t perform that action at this time.
0 commit comments