Bug #18332
closedunrecognized command line option '-fdiagnostics-color=always'
0%
Description
Although the following rule has been defined in the CMakeLists.txt, the 'diagnostics-color' option is added during source compiling while the gcc version is not actually support the option, typically, the gcc version lower than 4.9.
- Handle diagnostics color if compiler supports them.
CHECK_C_COMPILER_FLAG("-fdiagnostics-color=always"
COMPILER_SUPPORTS_DIAGNOSTICS_COLOR)
The message from the CMakeError.log
/usr/bin/cc -Wall -Wtype-limits -Wignored-qualifiers -Winit-self -Wpointer-arith -Werror=format-security -fno-strict-aliasing -fsigned-char -rdynamic -Wno-unknown-pragmas -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=2 -std=gnu99 -DCOMPILER_SUPPORTS_DIAGNOSTICS_COLOR -fPIE -fdiagnostics-color=always -o CMakeFiles/cmTryCompileExec2260236235.dir/src.c.o -c /home/dave/gerrit/ceph/build/CMakeFiles/CMakeTmp/src.c
cc: error: unrecognized command line option '-fdiagnostics-color=always'
make1: Leaving directory `/home/dave/gerrit/ceph/build/CMakeFiles/CMakeTmp'
make1: * [CMakeFiles/cmTryCompileExec2260236235.dir/src.c.o] Error 1make: * [cmTryCompileExec2260236235/fast] Error 2
Updated by Dave Chen over 7 years ago
This properly not a bug, these message from CMakeError.log should be caused by cmake test command, there must be other reason result in the failure of building.
Updated by Dave Chen over 7 years ago
Looks like I don't have the permission to change the status, anyone who can change the status pls kindly mark it as invalid.