cmake enable -Wcast-align and disable per module

This commit is contained in:
Daniel Agar 2019-03-16 11:23:17 -04:00
parent 13dba60149
commit b35d048566
68 changed files with 129 additions and 65 deletions

View File

@ -34,6 +34,8 @@
px4_add_module( px4_add_module(
MODULE modules__syslink MODULE modules__syslink
MAIN syslink MAIN syslink
COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
STACK_MAIN 1300 STACK_MAIN 1300
SRCS SRCS
syslink_main.cpp syslink_main.cpp
@ -41,5 +43,4 @@ px4_add_module(
syslink_memory.cpp syslink_memory.cpp
syslink_params.c syslink_params.c
syslink.c syslink.c
DEPENDS
) )

View File

@ -66,6 +66,7 @@ function(px4_add_common_flags)
-Werror -Werror
-Warray-bounds -Warray-bounds
-Wcast-align
-Wdisabled-optimization -Wdisabled-optimization
-Wdouble-promotion -Wdouble-promotion
-Wfatal-errors -Wfatal-errors
@ -79,8 +80,6 @@ function(px4_add_common_flags)
-Wunknown-pragmas -Wunknown-pragmas
-Wunused-variable -Wunused-variable
#-Wcast-align # TODO: fix and enable
# disabled warnings # disabled warnings
-Wno-implicit-fallthrough # set appropriate level and update -Wno-implicit-fallthrough # set appropriate level and update
-Wno-missing-field-initializers -Wno-missing-field-initializers

View File

@ -118,6 +118,10 @@ function(px4_add_module)
add_library(${MODULE} STATIC EXCLUDE_FROM_ALL ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_unity.cpp) add_library(${MODULE} STATIC EXCLUDE_FROM_ALL ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_unity.cpp)
target_include_directories(${MODULE} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(${MODULE} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
if(COMPILE_FLAGS)
target_compile_options(${MODULE}_original PRIVATE ${COMPILE_FLAGS})
endif()
if(DEPENDS) if(DEPENDS)
# using target_link_libraries for dependencies provides linking # using target_link_libraries for dependencies provides linking
# as well as interface include and libraries # as well as interface include and libraries

View File

@ -54,6 +54,7 @@ add_library(px4_layer
${SHMEM_SRCS} ${SHMEM_SRCS}
) )
target_compile_definitions(px4_layer PRIVATE MODULE_NAME="px4") target_compile_definitions(px4_layer PRIVATE MODULE_NAME="px4")
target_compile_options(px4_layer PRIVATE -Wno-cast-align) # TODO: fix and enable
target_link_libraries(px4_layer PRIVATE work_queue) target_link_libraries(px4_layer PRIVATE work_queue)
target_link_libraries(px4_layer PRIVATE px4_daemon) target_link_libraries(px4_layer PRIVATE px4_daemon)

View File

@ -133,6 +133,7 @@ function(px4_os_add_flags)
-fmath-errno -fmath-errno
-Wno-unknown-warning-option -Wno-unknown-warning-option
-Wno-cast-align
) )
# Clear -rdynamic flag which fails for hexagon # Clear -rdynamic flag which fails for hexagon

View File

@ -34,6 +34,8 @@
px4_add_module( px4_add_module(
MODULE drivers__bmp280 MODULE drivers__bmp280
MAIN bmp280 MAIN bmp280
COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
STACK_MAIN STACK_MAIN
1200 1200
SRCS SRCS

View File

@ -33,7 +33,6 @@
px4_add_module( px4_add_module(
MODULE drivers__barometer__lps22hb MODULE drivers__barometer__lps22hb
MAIN lps22hb MAIN lps22hb
COMPILE_FLAGS
SRCS SRCS
lps22hb_main.cpp lps22hb_main.cpp
LPS22HB.cpp LPS22HB.cpp

View File

@ -35,11 +35,9 @@ px4_add_module(
MAIN lps25h MAIN lps25h
STACK_MAIN 1200 STACK_MAIN 1200
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
lps25h.cpp lps25h.cpp
lps25h_i2c.cpp lps25h_i2c.cpp
lps25h_spi.cpp lps25h_spi.cpp
DEPENDS
) )

View File

@ -30,17 +30,13 @@
# POSSIBILITY OF SUCH DAMAGE. # POSSIBILITY OF SUCH DAMAGE.
# #
############################################################################ ############################################################################
set(srcs
mpl3115a2_i2c.cpp
mpl3115a2.cpp
)
px4_add_module( px4_add_module(
MODULE drivers__mpl3115a2 MODULE drivers__mpl3115a2
MAIN mpl3115a2 MAIN mpl3115a2
STACK_MAIN 1200 STACK_MAIN 1200
COMPILE_FLAGS COMPILE_FLAGS
SRCS ${srcs} -Wno-cast-align # TODO: fix and enable
DEPENDS SRCS
mpl3115a2_i2c.cpp
mpl3115a2.cpp
) )

View File

@ -30,18 +30,15 @@
# POSSIBILITY OF SUCH DAMAGE. # POSSIBILITY OF SUCH DAMAGE.
# #
############################################################################ ############################################################################
set(srcs
ms5611_spi.cpp
ms5611_i2c.cpp
ms5611.cpp
)
px4_add_module( px4_add_module(
MODULE drivers__ms5611 MODULE drivers__ms5611
MAIN ms5611 MAIN ms5611
STACK_MAIN 1500 STACK_MAIN 1500
COMPILE_FLAGS COMPILE_FLAGS
SRCS ${srcs} -Wno-cast-align # TODO: fix and enable
DEPENDS SRCS
ms5611_spi.cpp
ms5611_i2c.cpp
ms5611.cpp
) )

View File

@ -37,4 +37,5 @@ add_library(drivers_boards_common_arch
board_reset.c board_reset.c
) )
add_dependencies(drivers_boards_common_arch prebuild_targets) add_dependencies(drivers_boards_common_arch prebuild_targets)
target_compile_options(drivers_boards_common_arch PRIVATE -Wno-cast-align) # TODO: fix and enable
target_link_libraries(drivers_boards_common_arch PRIVATE nuttx_arch) target_link_libraries(drivers_boards_common_arch PRIVATE nuttx_arch)

View File

@ -39,4 +39,5 @@ add_library(drivers_boards_common_arch
board_critmon.c board_critmon.c
) )
add_dependencies(drivers_boards_common_arch prebuild_targets) add_dependencies(drivers_boards_common_arch prebuild_targets)
target_compile_options(drivers_boards_common_arch PRIVATE -Wno-cast-align) # TODO: fix and enable
target_link_libraries(drivers_boards_common_arch PRIVATE nuttx_arch) target_link_libraries(drivers_boards_common_arch PRIVATE nuttx_arch)

View File

@ -34,9 +34,10 @@ px4_add_module(
MODULE drivers__leddar_one MODULE drivers__leddar_one
MAIN leddar_one MAIN leddar_one
STACK_MAIN 1200 STACK_MAIN 1200
COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
leddar_one.cpp leddar_one.cpp
MODULE_CONFIG MODULE_CONFIG
module.yaml module.yaml
DEPENDS
) )

View File

@ -34,11 +34,10 @@ px4_add_module(
MODULE drivers__ll40ls MODULE drivers__ll40ls
MAIN ll40ls MAIN ll40ls
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
ll40ls.cpp ll40ls.cpp
LidarLite.cpp LidarLite.cpp
LidarLiteI2C.cpp LidarLiteI2C.cpp
LidarLitePWM.cpp LidarLitePWM.cpp
DEPENDS
) )

View File

@ -34,8 +34,7 @@ px4_add_module(
MODULE drivers__mb12xx MODULE drivers__mb12xx
MAIN mb12xx MAIN mb12xx
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
mb12xx.cpp mb12xx.cpp
DEPENDS
) )

View File

@ -33,6 +33,8 @@
px4_add_module( px4_add_module(
MODULE drivers__sf0x MODULE drivers__sf0x
MAIN sf0x MAIN sf0x
COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
sf0x.cpp sf0x.cpp
sf0x_parser.cpp sf0x_parser.cpp

View File

@ -31,10 +31,10 @@
# #
############################################################################ ############################################################################
px4_add_module( px4_add_module(
MODULE drivers__sf1xx MODULE drivers__sf1xx
MAIN sf1xx MAIN sf1xx
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
sf1xx.cpp sf1xx.cpp
DEPENDS DEPENDS

View File

@ -34,8 +34,7 @@ px4_add_module(
MODULE drivers__srf02 MODULE drivers__srf02
MAIN srf02 MAIN srf02
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
srf02.cpp srf02.cpp
DEPENDS
) )

View File

@ -35,6 +35,7 @@ px4_add_module(
MAIN teraranger MAIN teraranger
STACK_MAIN 1200 STACK_MAIN 1200
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
teraranger.cpp teraranger.cpp
DEPENDS DEPENDS

View File

@ -34,11 +34,10 @@ px4_add_module(
MODULE drivers__tfmini MODULE drivers__tfmini
MAIN tfmini MAIN tfmini
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
tfmini.cpp tfmini.cpp
tfmini_parser.cpp tfmini_parser.cpp
MODULE_CONFIG MODULE_CONFIG
module.yaml module.yaml
DEPENDS
) )

View File

@ -1,7 +1,41 @@
############################################################################
#
# Copyright (c) 2019 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
px4_add_module( px4_add_module(
MODULE drivers__vl53lxx MODULE drivers__vl53lxx
MAIN vl53lxx MAIN vl53lxx
COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
vl53lxx.cpp vl53lxx.cpp
) )
# vim: set noet ft=cmake fenc=utf-8 ff=unix :

View File

@ -37,6 +37,8 @@ px4_add_module(
MODULE drivers__gps MODULE drivers__gps
MAIN gps MAIN gps
STACK_MAIN 1200 STACK_MAIN 1200
COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
gps.cpp gps.cpp
devices/src/gps_helper.cpp devices/src/gps_helper.cpp

View File

@ -35,7 +35,7 @@ px4_add_module(
MAIN adis16448 MAIN adis16448
STACK_MAIN 1200 STACK_MAIN 1200
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
adis16448.cpp adis16448.cpp
DEPENDS
) )

View File

@ -35,6 +35,7 @@ px4_add_module(
MAIN adis16477 MAIN adis16477
STACK_MAIN 1200 STACK_MAIN 1200
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
ADIS16477.cpp ADIS16477.cpp
ADIS16477_gyro.cpp ADIS16477_gyro.cpp

View File

@ -35,6 +35,7 @@ px4_add_module(
MAIN adis16497 MAIN adis16497
STACK_MAIN 1200 STACK_MAIN 1200
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
ADIS16497.cpp ADIS16497.cpp
ADIS16497_gyro.cpp ADIS16497_gyro.cpp

View File

@ -34,8 +34,7 @@ px4_add_module(
MODULE drivers__bma180 MODULE drivers__bma180
MAIN bma180 MAIN bma180
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
bma180.cpp bma180.cpp
DEPENDS
) )

View File

@ -34,9 +34,10 @@ px4_add_module(
MODULE drivers__bmi055 MODULE drivers__bmi055
MAIN bmi055 MAIN bmi055
STACK_MAIN 1500 STACK_MAIN 1500
COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
BMI055_accel.cpp BMI055_accel.cpp
BMI055_gyro.cpp BMI055_gyro.cpp
bmi055_main.cpp bmi055_main.cpp
) )

View File

@ -35,10 +35,9 @@ px4_add_module(
MAIN bmi160 MAIN bmi160
STACK_MAIN 1200 STACK_MAIN 1200
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
bmi160.cpp bmi160.cpp
bmi160_gyro.cpp bmi160_gyro.cpp
bmi160_main.cpp bmi160_main.cpp
DEPENDS
) )

View File

@ -35,7 +35,7 @@ px4_add_module(
MAIN fxas21002c MAIN fxas21002c
STACK_MAIN 1500 STACK_MAIN 1500
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
fxas21002c.cpp fxas21002c.cpp
DEPENDS
) )

View File

@ -35,7 +35,7 @@ px4_add_module(
MAIN fxos8701cq MAIN fxos8701cq
STACK_MAIN 1500 STACK_MAIN 1500
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
fxos8701cq.cpp fxos8701cq.cpp
DEPENDS
) )

View File

@ -35,8 +35,7 @@ px4_add_module(
MAIN l3gd20 MAIN l3gd20
STACK_MAIN 1500 STACK_MAIN 1500
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
l3gd20.cpp l3gd20.cpp
DEPENDS
) )

View File

@ -35,8 +35,7 @@ px4_add_module(
MAIN lsm303d MAIN lsm303d
STACK_MAIN 1500 STACK_MAIN 1500
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
lsm303d.cpp lsm303d.cpp
DEPENDS
) )

View File

@ -34,8 +34,7 @@ px4_add_module(
MODULE drivers__irlock MODULE drivers__irlock
MAIN irlock MAIN irlock
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
irlock.cpp irlock.cpp
DEPENDS
) )

View File

@ -41,3 +41,4 @@ add_library(drivers_arch
) )
add_dependencies(drivers_arch prebuild_targets) add_dependencies(drivers_arch prebuild_targets)
target_link_libraries(drivers_arch PRIVATE drivers_board) target_link_libraries(drivers_arch PRIVATE drivers_board)
target_compile_options(drivers_arch PRIVATE -Wno-cast-align) # TODO: fix and enable

View File

@ -35,8 +35,7 @@ px4_add_module(
MAIN bmm150 MAIN bmm150
STACK_MAIN 1200 STACK_MAIN 1200
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
bmm150.cpp bmm150.cpp
DEPENDS
) )

View File

@ -35,10 +35,9 @@ px4_add_module(
MAIN hmc5883 MAIN hmc5883
STACK_MAIN 1500 STACK_MAIN 1500
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
hmc5883_i2c.cpp hmc5883_i2c.cpp
hmc5883_spi.cpp hmc5883_spi.cpp
hmc5883.cpp hmc5883.cpp
DEPENDS
) )

View File

@ -33,8 +33,9 @@
px4_add_module( px4_add_module(
MODULE drivers__ist8310 MODULE drivers__ist8310
MAIN ist8310 MAIN ist8310
COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
STACK_MAIN 1500 STACK_MAIN 1500
SRCS SRCS
ist8310.cpp ist8310.cpp
) )

View File

@ -35,11 +35,10 @@ px4_add_module(
MAIN lis3mdl MAIN lis3mdl
STACK_MAIN 1200 STACK_MAIN 1200
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
lis3mdl_i2c.cpp lis3mdl_i2c.cpp
lis3mdl_spi.cpp lis3mdl_spi.cpp
lis3mdl_main.cpp lis3mdl_main.cpp
lis3mdl.cpp lis3mdl.cpp
DEPENDS
) )

View File

@ -35,9 +35,9 @@ px4_add_module(
MAIN qmc5883 MAIN qmc5883
STACK_MAIN 1500 STACK_MAIN 1500
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
qmc5883_i2c.cpp qmc5883_i2c.cpp
qmc5883_spi.cpp qmc5883_spi.cpp
qmc5883.cpp qmc5883.cpp
DEPENDS
) )

View File

@ -35,10 +35,10 @@ px4_add_module(
MAIN rm3100 MAIN rm3100
STACK_MAIN 1200 STACK_MAIN 1200
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
rm3100_i2c.cpp rm3100_i2c.cpp
rm3100_spi.cpp rm3100_spi.cpp
rm3100_main.cpp rm3100_main.cpp
rm3100.cpp rm3100.cpp
DEPENDS
) )

View File

@ -34,6 +34,8 @@
px4_add_module( px4_add_module(
MODULE drivers__pmw3901 MODULE drivers__pmw3901
MAIN pmw3901 MAIN pmw3901
COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
STACK_MAIN 1200 STACK_MAIN 1200
SRCS SRCS
pmw3901.cpp pmw3901.cpp

View File

@ -36,7 +36,7 @@ px4_add_module(
STACK_MAIN 1024 STACK_MAIN 1024
COMPILE_FLAGS COMPILE_FLAGS
-Wno-pmf-conversions -Wno-pmf-conversions
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
pwm_input.cpp pwm_input.cpp
DEPENDS
) )

View File

@ -35,8 +35,7 @@ px4_add_module(
MAIN px4flow MAIN px4flow
STACK_MAIN 1200 STACK_MAIN 1200
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
px4flow.cpp px4flow.cpp
DEPENDS
) )

View File

@ -35,6 +35,7 @@ px4_add_module(
MAIN px4io MAIN px4io
STACK_MAIN 1816 STACK_MAIN 1816
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
px4io.cpp px4io.cpp
px4io_uploader.cpp px4io_uploader.cpp

View File

@ -41,3 +41,4 @@ add_library(drivers_arch
) )
add_dependencies(drivers_arch prebuild_targets) add_dependencies(drivers_arch prebuild_targets)
target_link_libraries(drivers_arch PRIVATE drivers_board) target_link_libraries(drivers_arch PRIVATE drivers_board)
target_compile_options(drivers_arch PRIVATE -Wno-cast-align) # TODO: fix and enable

View File

@ -63,6 +63,7 @@ add_definitions(
-DUAVCAN_PLATFORM=${UAVCAN_PLATFORM} -DUAVCAN_PLATFORM=${UAVCAN_PLATFORM}
) )
add_compile_options(-Wno-cast-align) # TODO: fix and enable
add_subdirectory(libuavcan EXCLUDE_FROM_ALL) add_subdirectory(libuavcan EXCLUDE_FROM_ALL)
add_dependencies(uavcan prebuild_targets) add_dependencies(uavcan prebuild_targets)

View File

@ -52,6 +52,7 @@ add_definitions(
-DUAVCAN_USE_EXTERNAL_SNPRINT -DUAVCAN_USE_EXTERNAL_SNPRINT
) )
add_compile_options(-Wno-cast-align) # TODO: fix and enable
add_subdirectory(${LIBUAVCAN_DIR} uavcanesc_libuavcan) add_subdirectory(${LIBUAVCAN_DIR} uavcanesc_libuavcan)
add_dependencies(uavcan prebuild_targets) add_dependencies(uavcan prebuild_targets)

View File

@ -52,6 +52,7 @@ add_definitions(
-DUAVCAN_USE_EXTERNAL_SNPRINT -DUAVCAN_USE_EXTERNAL_SNPRINT
) )
add_compile_options(-Wno-cast-align) # TODO: fix and enable
add_subdirectory(${LIBUAVCAN_DIR} uavcannode_libuavcan) add_subdirectory(${LIBUAVCAN_DIR} uavcannode_libuavcan)
add_dependencies(uavcan prebuild_targets) add_dependencies(uavcan prebuild_targets)

View File

@ -32,3 +32,4 @@
############################################################################ ############################################################################
px4_add_library(CollisionPrevention CollisionPrevention.cpp) px4_add_library(CollisionPrevention CollisionPrevention.cpp)
target_compile_options(CollisionPrevention PRIVATE -Wno-cast-align) # TODO: fix and enable

@ -1 +1 @@
Subproject commit 4b2eb055e534a09323c4f5c467aaff63c98dce7c Subproject commit 06277ef49fb8c9fad18d56ef40e8bc9fe1655a65

View File

@ -103,6 +103,8 @@ add_custom_command(
# Create Flight Tasks Library # Create Flight Tasks Library
########################################### ###########################################
add_compile_options(-Wno-cast-align) # TODO: fix and enable
px4_add_library(FlightTasks px4_add_library(FlightTasks
FlightTasks.cpp FlightTasks.cpp
FlightTasks_generated.cpp FlightTasks_generated.cpp

View File

@ -149,7 +149,11 @@ if (NOT "${PX4_BOARD}" MATCHES "px4_io")
target_link_libraries(parameters PRIVATE perf tinybson) target_link_libraries(parameters PRIVATE perf tinybson)
target_compile_definitions(parameters PRIVATE -DMODULE_NAME="parameters") target_compile_definitions(parameters PRIVATE -DMODULE_NAME="parameters")
target_compile_options(parameters PRIVATE -Wno-sign-compare) # TODO: fix this target_compile_options(parameters
PRIVATE
-Wno-cast-align # TODO: fix and enable
-Wno-sign-compare # TODO: fix and enable
)
else() else()
add_library(parameters ${PX4_SOURCE_DIR}/src/platforms/empty.c) add_library(parameters ${PX4_SOURCE_DIR}/src/platforms/empty.c)
endif() endif()

View File

@ -37,5 +37,9 @@ add_library(flashparams
) )
add_dependencies(flashparams prebuild_targets) add_dependencies(flashparams prebuild_targets)
target_compile_definitions(flashparams PRIVATE -DMODULE_NAME="flashparams") target_compile_definitions(flashparams PRIVATE -DMODULE_NAME="flashparams")
target_compile_options(flashparams PRIVATE -Wno-sign-compare) # TODO: fix this target_compile_options(flashparams
PRIVATE
-Wno-sign-compare # TODO: fix this
-Wno-cast-align # TODO: fix and enable
)
target_link_libraries(flashparams PRIVATE nuttx_arch) target_link_libraries(flashparams PRIVATE nuttx_arch)

View File

@ -39,6 +39,7 @@ px4_add_module(
STACK_MAIN 4096 STACK_MAIN 4096
STACK_MAX 2450 STACK_MAX 2450
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
accelerometer_calibration.cpp accelerometer_calibration.cpp
airspeed_calibration.cpp airspeed_calibration.cpp

View File

@ -35,6 +35,7 @@ px4_add_module(
MAIN dataman MAIN dataman
STACK_MAIN 1200 STACK_MAIN 1200
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
dataman.cpp dataman.cpp
) )

View File

@ -37,6 +37,7 @@ px4_add_module(
PRIORITY "SCHED_PRIORITY_MAX-30" PRIORITY "SCHED_PRIORITY_MAX-30"
STACK_MAIN 2200 STACK_MAIN 2200
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
logger.cpp logger.cpp
log_writer.cpp log_writer.cpp

View File

@ -39,6 +39,7 @@ px4_add_module(
STACK_MAIN 1600 STACK_MAIN 1600
STACK_MAX 1600 STACK_MAX 1600
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
INCLUDES INCLUDES
${PX4_SOURCE_DIR}/mavlink/include/mavlink ${PX4_SOURCE_DIR}/mavlink/include/mavlink
SRCS SRCS

View File

@ -42,6 +42,7 @@ px4_add_module(
#-DMAVLINK_FTP_DEBUG #-DMAVLINK_FTP_DEBUG
-DMavlinkStream=MavlinkStreamTest -DMavlinkStream=MavlinkStreamTest
-DMavlinkFTP=MavlinkFTPTest -DMavlinkFTP=MavlinkFTPTest
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
mavlink_tests.cpp mavlink_tests.cpp
mavlink_ftp_test.cpp mavlink_ftp_test.cpp

View File

@ -35,6 +35,8 @@ include(hexagon_sdk)
px4_add_module( px4_add_module(
MODULE modules__muorb__krait MODULE modules__muorb__krait
MAIN muorb MAIN muorb
COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
INCLUDES INCLUDES
${HEXAGON_SDK_INCLUDES} ${HEXAGON_SDK_INCLUDES}
${PX4_BINARY_DIR}/platforms/posix ${PX4_BINARY_DIR}/platforms/posix

View File

@ -60,6 +60,7 @@ px4_add_module(
MAIN simulator MAIN simulator
COMPILE_FLAGS COMPILE_FLAGS
-Wno-double-promotion -Wno-double-promotion
-Wno-cast-align
INCLUDES INCLUDES
${PX4_SOURCE_DIR}/mavlink/include/mavlink ${PX4_SOURCE_DIR}/mavlink/include/mavlink
SRCS SRCS

View File

@ -36,6 +36,7 @@ px4_add_module(
MAIN accelsim MAIN accelsim
COMPILE_FLAGS COMPILE_FLAGS
-Wno-double-promotion -Wno-double-promotion
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
accelsim.cpp accelsim.cpp
DEPENDS DEPENDS

View File

@ -36,6 +36,7 @@ px4_add_module(
MAIN measairspeedsim MAIN measairspeedsim
COMPILE_FLAGS COMPILE_FLAGS
-Wno-double-promotion -Wno-double-promotion
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
airspeedsim.cpp airspeedsim.cpp
meas_airspeed_sim.cpp meas_airspeed_sim.cpp

View File

@ -36,6 +36,7 @@ px4_add_module(
MAIN barosim MAIN barosim
COMPILE_FLAGS COMPILE_FLAGS
-Wno-double-promotion -Wno-double-promotion
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
baro.cpp baro.cpp
DEPENDS DEPENDS

View File

@ -36,6 +36,7 @@ px4_add_module(
MAIN gpssim MAIN gpssim
COMPILE_FLAGS COMPILE_FLAGS
-Wno-double-promotion -Wno-double-promotion
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
gpssim.cpp gpssim.cpp
DEPENDS DEPENDS

View File

@ -36,6 +36,7 @@ px4_add_module(
MAIN gyrosim MAIN gyrosim
COMPILE_FLAGS COMPILE_FLAGS
-Wno-double-promotion -Wno-double-promotion
-Wno-cast-align # TODO: fix and enable
STACK_MAIN 1200 STACK_MAIN 1200
SRCS SRCS
gyrosim.cpp gyrosim.cpp

View File

@ -51,6 +51,7 @@ if (NOT "${PX4_PLATFORM}" MATCHES "nuttx")
work_thread.c work_thread.c
) )
target_compile_definitions(work_queue PRIVATE MODULE_NAME="work_queue") target_compile_definitions(work_queue PRIVATE MODULE_NAME="work_queue")
target_compile_options(work_queue PRIVATE -Wno-cast-align) # TODO: fix and enable
add_dependencies(work_queue prebuild_targets) add_dependencies(work_queue prebuild_targets)
endif() endif()

View File

@ -35,8 +35,7 @@ px4_add_module(
MAIN bl_update MAIN bl_update
STACK_MAIN 4096 STACK_MAIN 4096
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
bl_update.c bl_update.c
DEPENDS
) )

View File

@ -35,6 +35,7 @@ px4_add_module(
MAIN hardfault_log MAIN hardfault_log
STACK_MAIN 2100 STACK_MAIN 2100
COMPILE_FLAGS COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS SRCS
hardfault_log.c hardfault_log.c
DEPENDS DEPENDS