cmake: compiler: Check -fdiagnostics-color=always before using
The -fdiagnostics-color flag is only on GCC versions 4.9.0 and newer. Previously, CMake only checked that the compiler was not the XCC compiler before using the flag. However, given that the flag us unavailable on compilers other than XCC, e.g. old versions of GCC, this patch replaces the previous logic with a flag-check using the check_set_compiler_property() CMake function. Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
This commit is contained in:
parent
f67939bf7e
commit
c7bc47c60d
1 changed files with 1 additions and 3 deletions
|
@ -232,9 +232,7 @@ set_property(TARGET compiler-cpp PROPERTY no_threadsafe_statics "-fno-threadsafe
|
||||||
set_property(TARGET asm PROPERTY required "-xassembler-with-cpp")
|
set_property(TARGET asm PROPERTY required "-xassembler-with-cpp")
|
||||||
|
|
||||||
# gcc flag for colourful diagnostic messages
|
# gcc flag for colourful diagnostic messages
|
||||||
if (NOT COMPILER STREQUAL "xcc")
|
check_set_compiler_property(PROPERTY diagnostic -fdiagnostics-color=always)
|
||||||
set_compiler_property(PROPERTY diagnostic -fdiagnostics-color=always)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Compiler flag for disabling pointer arithmetic warnings
|
# Compiler flag for disabling pointer arithmetic warnings
|
||||||
set_compiler_property(PROPERTY warning_no_pointer_arithmetic "-Wno-pointer-arith")
|
set_compiler_property(PROPERTY warning_no_pointer_arithmetic "-Wno-pointer-arith")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue