[llvm-commits] [llvm] r156150 - /llvm/trunk/cmake/modules/HandleLLVMOptions.cmake

Tom Care tom.care at uqconnect.edu.au
Fri May 4 08:34:07 PDT 2012


Hi Rafael,

This change will break things for a few people. Eclipse CDT and possibly other clients don't handle ANSI codes well and this can break diagnostic parsing. There should be a way to explicitly disable colour diagnostics for non-ANSI aware clients.

Perhaps a workaround is to make this dependent on the CMAKE_COLOR_MAKEFILE flag, since it would be strange to have no colour for the makefiles but still have colour for diagnostics. The flag description seems to refer to the whole build process rather than just the makefiles so it seems appropriate enough.

Tom

On 04/05/2012, at 5:23 AM, Rafael Espindola wrote:

> Author: rafael
> Date: Thu May  3 22:23:36 2012
> New Revision: 156150
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=156150&view=rev
> Log:
> Pass -fcolor-diagnostics when it is supported. This makes a difference when
> using cmake+ninja, since ninja buffers the compiler output.
> 
> Modified:
>    llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
> 
> Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=156150&r1=156149&r2=156150&view=diff
> ==============================================================================
> --- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
> +++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Thu May  3 22:23:36 2012
> @@ -190,6 +190,10 @@
>     if( SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG )
>       add_llvm_definitions( -Wcovered-switch-default )
>     endif()
> +    check_cxx_compiler_flag("-Werror -fcolor-diagnostics" SUPPORTS_FCOLOR_DIAGNOSTICS_FLAG)
> +    if( SUPPORTS_FCOLOR_DIAGNOSTICS_FLAG )
> +      add_llvm_definitions( -fcolor-diagnostics )
> +    endif()
>   endif (LLVM_ENABLE_WARNINGS)
>   if (LLVM_ENABLE_WERROR)
>     add_llvm_definitions( -Werror )
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 






More information about the llvm-commits mailing list