mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 06:23:33 +08:00
Robustify toolchain string matching
This commit is contained in:
@@ -512,7 +512,7 @@ function(px4_add_common_flags)
|
||||
list(APPEND warnings -Wframe-larger-than=1024)
|
||||
endif()
|
||||
|
||||
if (${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
|
||||
if (${CMAKE_C_COMPILER_ID} MATCHES ".*Clang.*")
|
||||
# QuRT 6.4.X compiler identifies as Clang but does not support this option
|
||||
if (NOT ${OS} STREQUAL "qurt")
|
||||
list(APPEND warnings
|
||||
@@ -540,7 +540,7 @@ function(px4_add_common_flags)
|
||||
-fdata-sections
|
||||
)
|
||||
|
||||
if (NOT ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
|
||||
if (NOT ${CMAKE_C_COMPILER_ID} MATCHES ".*Clang.*")
|
||||
list(APPEND optimization_flags
|
||||
-fno-strength-reduce
|
||||
-fno-builtin-printf
|
||||
@@ -554,7 +554,7 @@ function(px4_add_common_flags)
|
||||
-Wnested-externs
|
||||
)
|
||||
|
||||
if (NOT ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
|
||||
if (NOT ${CMAKE_C_COMPILER_ID} MATCHES ".*Clang.*")
|
||||
list(APPEND c_warnings
|
||||
-Wold-style-declaration
|
||||
-Wmissing-parameter-type
|
||||
@@ -633,16 +633,10 @@ function(px4_add_common_flags)
|
||||
-DCONFIG_ARCH_BOARD_${board_config}
|
||||
)
|
||||
|
||||
if (NOT ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
|
||||
set(added_exe_link_flags
|
||||
-Wl,--warn-common
|
||||
-Wl,--gc-sections
|
||||
)
|
||||
else()
|
||||
|
||||
set(added_exe_link_flags
|
||||
-Wl,--warn-common
|
||||
)
|
||||
endif()
|
||||
|
||||
# output
|
||||
foreach(var ${inout_vars})
|
||||
|
||||
Reference in New Issue
Block a user