cmake add -Wmissing-field-initializers and a few others

This commit is contained in:
Daniel Agar 2017-06-03 13:55:33 -04:00 committed by Nuno Marques
parent d3ed773838
commit 35e15ed540
4 changed files with 21 additions and 13 deletions

View File

@ -325,6 +325,7 @@ function(px4_add_common_flags)
set(warnings
-Wall
-Warray-bounds
-Wdisabled-optimization
-Werror
-Wextra
-Wfatal-errors
@ -332,9 +333,12 @@ function(px4_add_common_flags)
-Wformat-security
-Winit-self
-Wmissing-declarations
-Wmissing-field-initializers
#-Wmissing-include-dirs # TODO: fix and enable
-Wpointer-arith
-Wshadow
-Wuninitialized
-Wunknown-pragmas
-Wunused-variable
-Wno-unused-parameter
@ -362,17 +366,12 @@ function(px4_add_common_flags)
)
endif()
if ("${OS}" STREQUAL "qurt")
set(PIC_FLAG -fPIC)
endif()
set(_optimization_flags
-fno-strict-aliasing
-fomit-frame-pointer
-funsafe-math-optimizations
-ffunction-sections
-fdata-sections
${PIC_FLAG}
)
set(c_warnings

View File

@ -225,7 +225,7 @@ function(px4_os_add_flags)
endif()
# 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
${POSIX_CMAKE_CXX_FLAGS}
@ -248,7 +248,7 @@ function(px4_os_add_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
${POSIX_CMAKE_CXX_FLAGS}

View File

@ -163,24 +163,34 @@ function(px4_os_add_flags)
set(DSPAL_ROOT src/lib/DriverFramework/dspal)
set(added_include_dirs
${DSPAL_ROOT}/include
${DSPAL_ROOT}/mpu_spi/inc
${DSPAL_ROOT}/sys
${DSPAL_ROOT}/sys/sys
${DSPAL_ROOT}/mpu_spi/inc
${DSPAL_ROOT}/uart_esc/inc
src/platforms/qurt/include
src/platforms/posix/include
src/platforms/qurt/include
)
set(added_definitions
-D__PX4_QURT
-D__DF_QURT # For DriverFramework
-D__PX4_POSIX
-D__PX4_QURT
-D__QAIC_SKEL_EXPORT=__EXPORT
)
# Add the toolchain specific flags
set(added_cflags)
set(added_cxx_flags)
set(added_c_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
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")

View File

@ -30,7 +30,6 @@
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
include_directories(../navio_gpio)
px4_add_module(
MODULE drivers__navio_rgbled