Changeset - r24303:287e51ec3b6d
[Not reviewed]
master
0 2 0
Dan Villiom Podlaski Christiansen - 4 years ago 2020-06-04 12:38:56
danchr@gmail.com
Add: add option for forcing coloured compiler output (useful for Ninja)
2 files changed with 15 insertions and 0 deletions:
0 comments (0 inline, 0 general)
cmake/CompileFlags.cmake
Show inline comments
 
@@ -82,6 +82,19 @@ macro(compile_flags)
 
            "$<${IS_STABLE_RELEASE}:-Wno-unused-but-set-variable>"
 
        )
 

	
 
        # Ninja processes the output so the output from the compiler
 
        # isn't directly to a terminal; hence, the default is
 
        # non-coloured output. We can override this to get nicely
 
        # coloured output, but since that might yield odd results with
 
        # IDEs, we extract it to an option.
 
        if (OPTION_FORCE_COLORED_OUTPUT)
 
            if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
 
                add_compile_options (-fdiagnostics-color=always)
 
            elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
 
                add_compile_options (-fcolor-diagnostics)
 
            endif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
 
        endif (OPTION_FORCE_COLORED_OUTPUT)
 

	
 
        if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
 
            include(CheckCXXCompilerFlag)
 
            check_cxx_compiler_flag("-flifetime-dse=1" LIFETIME_DSE_FOUND)
cmake/Options.cmake
Show inline comments
 
@@ -48,6 +48,8 @@ function(set_options)
 
        set(DEFAULT_OPTION_INSTALL_FHS OFF)
 
    endif (UNIX AND NOT APPLE)
 

	
 
    option(OPTION_FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." OFF)
 

	
 
    option(OPTION_DEDICATED "Build dedicated server only (no GUI)" OFF)
 
    option(OPTION_INSTALL_FHS "Install with Filesstem Hierarchy Standard folders" ${DEFAULT_OPTION_INSTALL_FHS})
 
    option(OPTION_USE_ASSERTS "Use assertions; leave enabled for nightlies, betas, and RCs" ON)
0 comments (0 inline, 0 general)