cmake: fix the fdiagnostics-color handle issue
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
This commit is contained in:
parent
9614e1fed5
commit
65aa5415a7
|
@ -391,14 +391,14 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/arch/${CONFIG_ARCH}/src/cmake)
|
||||||
set(CMAKE_TOOLCHAIN_FILE
|
set(CMAKE_TOOLCHAIN_FILE
|
||||||
"${CMAKE_SOURCE_DIR}/arch/${CONFIG_ARCH}/src/cmake/Toolchain.cmake")
|
"${CMAKE_SOURCE_DIR}/arch/${CONFIG_ARCH}/src/cmake/Toolchain.cmake")
|
||||||
|
|
||||||
# include common toolchain setting
|
|
||||||
include(nuttx_toolchain)
|
|
||||||
|
|
||||||
# Define project #############################################################
|
# Define project #############################################################
|
||||||
# This triggers configuration
|
# This triggers configuration
|
||||||
|
|
||||||
project(NuttX LANGUAGES C CXX ASM)
|
project(NuttX LANGUAGES C CXX ASM)
|
||||||
|
|
||||||
|
# include common toolchain setting
|
||||||
|
include(nuttx_toolchain)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
enable_language(ASM_MASM)
|
enable_language(ASM_MASM)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -53,11 +53,6 @@ endif()
|
||||||
|
|
||||||
set(NO_LTO "-fno-lto")
|
set(NO_LTO "-fno-lto")
|
||||||
|
|
||||||
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.9)
|
|
||||||
# force color for gcc > 4.9
|
|
||||||
add_compile_options(-fdiagnostics-color=always)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Workaround to skip -Warray-bounds check due to bug of GCC-12: Wrong warning
|
# Workaround to skip -Warray-bounds check due to bug of GCC-12: Wrong warning
|
||||||
# array subscript [0] is outside array bounds:
|
# array subscript [0] is outside array bounds:
|
||||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
|
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
|
||||||
|
|
|
@ -23,6 +23,13 @@
|
||||||
# search. If the manual of the newly supported toolchain is different, you can
|
# search. If the manual of the newly supported toolchain is different, you can
|
||||||
# override these methods in the toolchain
|
# override these methods in the toolchain
|
||||||
|
|
||||||
|
if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
|
||||||
|
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.9)
|
||||||
|
# force color for gcc > 4.9
|
||||||
|
add_compile_options(-fdiagnostics-color=always)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# Support CMake to define additional configuration options
|
# Support CMake to define additional configuration options
|
||||||
|
|
||||||
if(EXTRA_FLAGS)
|
if(EXTRA_FLAGS)
|
||||||
|
|
Loading…
Reference in New Issue