mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 10:26:52 +08:00
cmake add -Wmissing-field-initializers and a few others
This commit is contained in:
committed by
Nuno Marques
parent
d3ed773838
commit
35e15ed540
@@ -325,6 +325,7 @@ function(px4_add_common_flags)
|
|||||||
set(warnings
|
set(warnings
|
||||||
-Wall
|
-Wall
|
||||||
-Warray-bounds
|
-Warray-bounds
|
||||||
|
-Wdisabled-optimization
|
||||||
-Werror
|
-Werror
|
||||||
-Wextra
|
-Wextra
|
||||||
-Wfatal-errors
|
-Wfatal-errors
|
||||||
@@ -332,9 +333,12 @@ function(px4_add_common_flags)
|
|||||||
-Wformat-security
|
-Wformat-security
|
||||||
-Winit-self
|
-Winit-self
|
||||||
-Wmissing-declarations
|
-Wmissing-declarations
|
||||||
|
-Wmissing-field-initializers
|
||||||
|
#-Wmissing-include-dirs # TODO: fix and enable
|
||||||
-Wpointer-arith
|
-Wpointer-arith
|
||||||
-Wshadow
|
-Wshadow
|
||||||
-Wuninitialized
|
-Wuninitialized
|
||||||
|
-Wunknown-pragmas
|
||||||
-Wunused-variable
|
-Wunused-variable
|
||||||
|
|
||||||
-Wno-unused-parameter
|
-Wno-unused-parameter
|
||||||
@@ -362,17 +366,12 @@ function(px4_add_common_flags)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if ("${OS}" STREQUAL "qurt")
|
|
||||||
set(PIC_FLAG -fPIC)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(_optimization_flags
|
set(_optimization_flags
|
||||||
-fno-strict-aliasing
|
-fno-strict-aliasing
|
||||||
-fomit-frame-pointer
|
-fomit-frame-pointer
|
||||||
-funsafe-math-optimizations
|
-funsafe-math-optimizations
|
||||||
-ffunction-sections
|
-ffunction-sections
|
||||||
-fdata-sections
|
-fdata-sections
|
||||||
${PIC_FLAG}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set(c_warnings
|
set(c_warnings
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ function(px4_os_add_flags)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Add the toolchain specific flags
|
# Add the toolchain specific flags
|
||||||
set(added_cflags ${POSIX_CMAKE_C_FLAGS} --sysroot=${HEXAGON_ARM_SYSROOT})
|
set(added_c_flags ${POSIX_CMAKE_C_FLAGS} --sysroot=${HEXAGON_ARM_SYSROOT})
|
||||||
|
|
||||||
list(APPEND added_cxx_flags
|
list(APPEND added_cxx_flags
|
||||||
${POSIX_CMAKE_CXX_FLAGS}
|
${POSIX_CMAKE_CXX_FLAGS}
|
||||||
@@ -248,7 +248,7 @@ function(px4_os_add_flags)
|
|||||||
|
|
||||||
# Add the toolchain specific flags
|
# Add the toolchain specific flags
|
||||||
|
|
||||||
set(added_cflags ${POSIX_CMAKE_C_FLAGS} --sysroot=${HEXAGON_ARM_SYSROOT}/lib32-apq8096 -mfloat-abi=softfp -mfpu=neon -mthumb-interwork)
|
set(added_c_flags ${POSIX_CMAKE_C_FLAGS} --sysroot=${HEXAGON_ARM_SYSROOT}/lib32-apq8096 -mfloat-abi=softfp -mfpu=neon -mthumb-interwork)
|
||||||
|
|
||||||
list(APPEND added_cxx_flags
|
list(APPEND added_cxx_flags
|
||||||
${POSIX_CMAKE_CXX_FLAGS}
|
${POSIX_CMAKE_CXX_FLAGS}
|
||||||
|
|||||||
@@ -163,24 +163,34 @@ function(px4_os_add_flags)
|
|||||||
set(DSPAL_ROOT src/lib/DriverFramework/dspal)
|
set(DSPAL_ROOT src/lib/DriverFramework/dspal)
|
||||||
set(added_include_dirs
|
set(added_include_dirs
|
||||||
${DSPAL_ROOT}/include
|
${DSPAL_ROOT}/include
|
||||||
|
${DSPAL_ROOT}/mpu_spi/inc
|
||||||
${DSPAL_ROOT}/sys
|
${DSPAL_ROOT}/sys
|
||||||
${DSPAL_ROOT}/sys/sys
|
${DSPAL_ROOT}/sys/sys
|
||||||
${DSPAL_ROOT}/mpu_spi/inc
|
|
||||||
${DSPAL_ROOT}/uart_esc/inc
|
${DSPAL_ROOT}/uart_esc/inc
|
||||||
src/platforms/qurt/include
|
|
||||||
src/platforms/posix/include
|
src/platforms/posix/include
|
||||||
|
src/platforms/qurt/include
|
||||||
)
|
)
|
||||||
|
|
||||||
set(added_definitions
|
set(added_definitions
|
||||||
-D__PX4_QURT
|
|
||||||
-D__DF_QURT # For DriverFramework
|
-D__DF_QURT # For DriverFramework
|
||||||
-D__PX4_POSIX
|
-D__PX4_POSIX
|
||||||
|
-D__PX4_QURT
|
||||||
-D__QAIC_SKEL_EXPORT=__EXPORT
|
-D__QAIC_SKEL_EXPORT=__EXPORT
|
||||||
)
|
)
|
||||||
|
|
||||||
# Add the toolchain specific flags
|
# Add the toolchain specific flags
|
||||||
set(added_cflags)
|
set(added_c_flags
|
||||||
set(added_cxx_flags)
|
-Wno-unknown-warning-option
|
||||||
|
)
|
||||||
|
|
||||||
|
set(added_cxx_flags
|
||||||
|
-Wno-unknown-warning-option
|
||||||
|
-Wno-unreachable-code
|
||||||
|
)
|
||||||
|
|
||||||
|
set(added_optimization_flags
|
||||||
|
-fPIC
|
||||||
|
)
|
||||||
|
|
||||||
# Clear -rdynamic flag which fails for hexagon
|
# Clear -rdynamic flag which fails for hexagon
|
||||||
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
|
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
include_directories(../navio_gpio)
|
|
||||||
|
|
||||||
px4_add_module(
|
px4_add_module(
|
||||||
MODULE drivers__navio_rgbled
|
MODULE drivers__navio_rgbled
|
||||||
|
|||||||
Reference in New Issue
Block a user