From 03b805483edc019caad6cc41346b8f5a5b245011 Mon Sep 17 00:00:00 2001 From: Alexander Lerach Date: Thu, 28 Nov 2024 10:12:43 +0100 Subject: [PATCH] added module specific speed/space optimization selection. Set drivers to optimize for speed --- CMakeLists.txt | 15 ++++++++++----- platforms/common/px4_work_queue/CMakeLists.txt | 2 +- platforms/common/uORB/CMakeLists.txt | 4 ++-- .../nuttx/src/px4/nxp/imxrt/dshot/CMakeLists.txt | 2 +- .../nuttx/src/px4/nxp/imxrt/spi/CMakeLists.txt | 2 +- .../src/px4/rpi/rpi_common/hrt/CMakeLists.txt | 2 +- .../src/px4/rpi/rpi_common/io_pins/CMakeLists.txt | 2 +- .../src/px4/rpi/rpi_common/spi/CMakeLists.txt | 2 +- .../src/px4/stm/stm32_common/dshot/CMakeLists.txt | 2 +- .../src/px4/stm/stm32_common/hrt/CMakeLists.txt | 2 +- .../px4/stm/stm32_common/io_pins/CMakeLists.txt | 2 +- .../src/px4/stm/stm32_common/spi/CMakeLists.txt | 2 +- .../imu/analog_devices/adis16448/CMakeLists.txt | 2 +- .../imu/invensense/icm42688p/CMakeLists.txt | 2 +- .../imu/invensense/icm45686/CMakeLists.txt | 2 +- .../imu/invensense/iim42652/CMakeLists.txt | 2 +- .../imu/invensense/iim42653/CMakeLists.txt | 2 +- src/examples/fake_imu/CMakeLists.txt | 2 +- src/lib/cdev/CMakeLists.txt | 2 +- src/lib/conversion/CMakeLists.txt | 2 +- src/lib/crc/CMakeLists.txt | 2 +- src/lib/drivers/accelerometer/CMakeLists.txt | 2 +- src/lib/drivers/gyroscope/CMakeLists.txt | 2 +- src/lib/geo/CMakeLists.txt | 2 +- src/lib/heatshrink/CMakeLists.txt | 2 +- src/lib/mixer_module/CMakeLists.txt | 2 +- src/lib/parameters/CMakeLists.txt | 4 ++-- src/lib/perf/CMakeLists.txt | 2 +- src/lib/rate_control/CMakeLists.txt | 2 +- src/lib/systemlib/CMakeLists.txt | 2 +- src/lib/tinybson/CMakeLists.txt | 2 +- src/lib/world_magnetic_model/CMakeLists.txt | 2 +- .../ActuatorEffectiveness/CMakeLists.txt | 2 +- src/modules/control_allocator/CMakeLists.txt | 2 +- .../ControlAllocation/CMakeLists.txt | 2 +- src/modules/ekf2/CMakeLists.txt | 2 +- src/modules/ekf2/EKF/lat_lon_alt/CMakeLists.txt | 2 +- .../follow_target_estimator/CMakeLists.txt | 2 +- .../fw_autotune_attitude_control/CMakeLists.txt | 2 +- src/modules/gyro_fft/CMakeLists.txt | 2 +- src/modules/logger/CMakeLists.txt | 2 +- .../mc_att_control/AttitudeControl/CMakeLists.txt | 2 +- src/modules/mc_att_control/CMakeLists.txt | 2 +- .../mc_autotune_attitude_control/CMakeLists.txt | 2 +- .../mc_hover_thrust_estimator/CMakeLists.txt | 2 +- src/modules/mc_rate_control/CMakeLists.txt | 2 +- .../sensors/vehicle_acceleration/CMakeLists.txt | 2 +- .../vehicle_angular_velocity/CMakeLists.txt | 2 +- src/modules/sensors/vehicle_imu/CMakeLists.txt | 2 +- src/modules/simulation/gz_bridge/CMakeLists.txt | 2 +- .../simulation/simulator_sih/CMakeLists.txt | 2 +- src/modules/uxrce_dds_client/CMakeLists.txt | 2 +- 52 files changed, 63 insertions(+), 58 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 55362b1425..ac74fd569d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -241,19 +241,24 @@ if(NOT CMAKE_BUILD_TYPE) endif() if((CMAKE_BUILD_TYPE STREQUAL "Debug") OR (CMAKE_BUILD_TYPE STREQUAL "Coverage")) - set(MAX_CUSTOM_OPT_LEVEL -O0) + set(MAX_CUSTOM_OPT_LEVEL_SPEED -O0) elseif(CMAKE_BUILD_TYPE MATCHES "Sanitizer") - set(MAX_CUSTOM_OPT_LEVEL -O1) + set(MAX_CUSTOM_OPT_LEVEL_SPEED -O1) elseif(CMAKE_BUILD_TYPE MATCHES "Release") - set(MAX_CUSTOM_OPT_LEVEL -O3) + set(MAX_CUSTOM_OPT_LEVEL_SPEED -O3) else() if(px4_constrained_flash_build) - set(MAX_CUSTOM_OPT_LEVEL -Os) + set(MAX_CUSTOM_OPT_LEVEL_SPEED -Os) else() - set(MAX_CUSTOM_OPT_LEVEL -O2) + set(MAX_CUSTOM_OPT_LEVEL_SPEED -O2) + set(MAX_CUSTOM_OPT_LEVEL_SPACE -Os) endif() endif() +if(NOT MAX_CUSTOM_OPT_LEVEL_SPACE) + set(MAX_CUSTOM_OPT_LEVEL_SPACE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) +endif() + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug;Release;RelWithDebInfo;MinSizeRel;Coverage;AddressSanitizer;UndefinedBehaviorSanitizer") message(STATUS "cmake build type: ${CMAKE_BUILD_TYPE}") diff --git a/platforms/common/px4_work_queue/CMakeLists.txt b/platforms/common/px4_work_queue/CMakeLists.txt index 01f8cc3db2..3b842fa920 100644 --- a/platforms/common/px4_work_queue/CMakeLists.txt +++ b/platforms/common/px4_work_queue/CMakeLists.txt @@ -43,4 +43,4 @@ if(PX4_TESTING) add_subdirectory(test) endif() -target_compile_options(px4_work_queue PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(px4_work_queue PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) diff --git a/platforms/common/uORB/CMakeLists.txt b/platforms/common/uORB/CMakeLists.txt index 2e3add770e..d17a63ff70 100644 --- a/platforms/common/uORB/CMakeLists.txt +++ b/platforms/common/uORB/CMakeLists.txt @@ -80,7 +80,7 @@ if (NOT DEFINED CONFIG_BUILD_FLAT AND "${PX4_PLATFORM}" MATCHES "nuttx") ${SRCS_KERNEL} ) target_link_libraries(uORB_kernel PRIVATE cdev uorb_msgs nuttx_mm heatshrink) - target_compile_options(uORB_kernel PRIVATE ${MAX_CUSTOM_OPT_LEVEL} -D__KERNEL__) + target_compile_options(uORB_kernel PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED} -D__KERNEL__) # User side library in nuttx kernel/protected build px4_add_library(uORB @@ -106,7 +106,7 @@ else() endif() target_link_libraries(uORB PRIVATE uorb_msgs heatshrink) -target_compile_options(uORB PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(uORB PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) if(PX4_TESTING) add_subdirectory(uORB_tests) diff --git a/platforms/nuttx/src/px4/nxp/imxrt/dshot/CMakeLists.txt b/platforms/nuttx/src/px4/nxp/imxrt/dshot/CMakeLists.txt index d8a7900d40..ab75a639f6 100644 --- a/platforms/nuttx/src/px4/nxp/imxrt/dshot/CMakeLists.txt +++ b/platforms/nuttx/src/px4/nxp/imxrt/dshot/CMakeLists.txt @@ -34,4 +34,4 @@ px4_add_library(arch_dshot dshot.c ) -target_compile_options(arch_dshot PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(arch_dshot PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) diff --git a/platforms/nuttx/src/px4/nxp/imxrt/spi/CMakeLists.txt b/platforms/nuttx/src/px4/nxp/imxrt/spi/CMakeLists.txt index 32bb104153..c68b8e3993 100644 --- a/platforms/nuttx/src/px4/nxp/imxrt/spi/CMakeLists.txt +++ b/platforms/nuttx/src/px4/nxp/imxrt/spi/CMakeLists.txt @@ -34,6 +34,6 @@ px4_add_library(arch_spi spi.cpp ) -target_compile_options(arch_spi PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(arch_spi PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) target_link_libraries (arch_spi PRIVATE drivers_board) # px4_spi_buses diff --git a/platforms/nuttx/src/px4/rpi/rpi_common/hrt/CMakeLists.txt b/platforms/nuttx/src/px4/rpi/rpi_common/hrt/CMakeLists.txt index 9ce26ff632..aea0ba6d60 100644 --- a/platforms/nuttx/src/px4/rpi/rpi_common/hrt/CMakeLists.txt +++ b/platforms/nuttx/src/px4/rpi/rpi_common/hrt/CMakeLists.txt @@ -36,6 +36,6 @@ px4_add_library(arch_hrt ) target_compile_options(arch_hrt PRIVATE - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPEED} -Wno-cast-align # TODO: fix and enable ) diff --git a/platforms/nuttx/src/px4/rpi/rpi_common/io_pins/CMakeLists.txt b/platforms/nuttx/src/px4/rpi/rpi_common/io_pins/CMakeLists.txt index 889c5004dd..aea9d1e9c4 100644 --- a/platforms/nuttx/src/px4/rpi/rpi_common/io_pins/CMakeLists.txt +++ b/platforms/nuttx/src/px4/rpi/rpi_common/io_pins/CMakeLists.txt @@ -39,6 +39,6 @@ px4_add_library(arch_io_pins rp2040_pinset.c ) -target_compile_options(arch_io_pins PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(arch_io_pins PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) target_link_libraries(arch_io_pins PRIVATE drivers_board) diff --git a/platforms/nuttx/src/px4/rpi/rpi_common/spi/CMakeLists.txt b/platforms/nuttx/src/px4/rpi/rpi_common/spi/CMakeLists.txt index dda6d7c98e..53e375f114 100644 --- a/platforms/nuttx/src/px4/rpi/rpi_common/spi/CMakeLists.txt +++ b/platforms/nuttx/src/px4/rpi/rpi_common/spi/CMakeLists.txt @@ -34,4 +34,4 @@ px4_add_library(arch_spi spi.cpp ) -target_compile_options(arch_spi PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(arch_spi PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) diff --git a/platforms/nuttx/src/px4/stm/stm32_common/dshot/CMakeLists.txt b/platforms/nuttx/src/px4/stm/stm32_common/dshot/CMakeLists.txt index 5221ae896a..0026684d20 100644 --- a/platforms/nuttx/src/px4/stm/stm32_common/dshot/CMakeLists.txt +++ b/platforms/nuttx/src/px4/stm/stm32_common/dshot/CMakeLists.txt @@ -34,4 +34,4 @@ px4_add_library(arch_dshot dshot.c ) -target_compile_options(arch_dshot PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(arch_dshot PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) diff --git a/platforms/nuttx/src/px4/stm/stm32_common/hrt/CMakeLists.txt b/platforms/nuttx/src/px4/stm/stm32_common/hrt/CMakeLists.txt index 82854e0def..98a40eb761 100644 --- a/platforms/nuttx/src/px4/stm/stm32_common/hrt/CMakeLists.txt +++ b/platforms/nuttx/src/px4/stm/stm32_common/hrt/CMakeLists.txt @@ -36,6 +36,6 @@ px4_add_library(arch_hrt ) target_compile_options(arch_hrt PRIVATE - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPEED} -Wno-cast-align # TODO: fix and enable ) diff --git a/platforms/nuttx/src/px4/stm/stm32_common/io_pins/CMakeLists.txt b/platforms/nuttx/src/px4/stm/stm32_common/io_pins/CMakeLists.txt index fd2a22debb..0364ea438b 100644 --- a/platforms/nuttx/src/px4/stm/stm32_common/io_pins/CMakeLists.txt +++ b/platforms/nuttx/src/px4/stm/stm32_common/io_pins/CMakeLists.txt @@ -37,6 +37,6 @@ px4_add_library(arch_io_pins pwm_servo.c pwm_trigger.c ) -target_compile_options(arch_io_pins PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(arch_io_pins PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) target_link_libraries(arch_io_pins PRIVATE drivers_board) # timer_io_channels diff --git a/platforms/nuttx/src/px4/stm/stm32_common/spi/CMakeLists.txt b/platforms/nuttx/src/px4/stm/stm32_common/spi/CMakeLists.txt index e4627c30bb..9354dd67af 100644 --- a/platforms/nuttx/src/px4/stm/stm32_common/spi/CMakeLists.txt +++ b/platforms/nuttx/src/px4/stm/stm32_common/spi/CMakeLists.txt @@ -34,6 +34,6 @@ px4_add_library(arch_spi spi.cpp ) -target_compile_options(arch_spi PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(arch_spi PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) target_link_libraries (arch_spi PRIVATE drivers_board) # px4_spi_buses diff --git a/src/drivers/imu/analog_devices/adis16448/CMakeLists.txt b/src/drivers/imu/analog_devices/adis16448/CMakeLists.txt index b8f8d690fc..fbc3f3bd88 100644 --- a/src/drivers/imu/analog_devices/adis16448/CMakeLists.txt +++ b/src/drivers/imu/analog_devices/adis16448/CMakeLists.txt @@ -35,7 +35,7 @@ px4_add_module( MODULE drivers__imu__analog_devices__adis16448 MAIN adis16448 COMPILE_FLAGS - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPACE} #-DDEBUG_BUILD SRCS ADIS16448.cpp diff --git a/src/drivers/imu/invensense/icm42688p/CMakeLists.txt b/src/drivers/imu/invensense/icm42688p/CMakeLists.txt index 113ebc6d65..30afd561a0 100644 --- a/src/drivers/imu/invensense/icm42688p/CMakeLists.txt +++ b/src/drivers/imu/invensense/icm42688p/CMakeLists.txt @@ -34,7 +34,7 @@ px4_add_module( MODULE drivers__imu__invensense__icm42688p MAIN icm42688p COMPILE_FLAGS - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPACE} #-DDEBUG_BUILD SRCS icm42688p_main.cpp diff --git a/src/drivers/imu/invensense/icm45686/CMakeLists.txt b/src/drivers/imu/invensense/icm45686/CMakeLists.txt index ec4e9139e7..3adcd138df 100644 --- a/src/drivers/imu/invensense/icm45686/CMakeLists.txt +++ b/src/drivers/imu/invensense/icm45686/CMakeLists.txt @@ -34,7 +34,7 @@ px4_add_module( MODULE drivers__imu__invensense__icm45686 MAIN icm45686 COMPILE_FLAGS - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPACE} #-DDEBUG_BUILD SRCS icm45686_main.cpp diff --git a/src/drivers/imu/invensense/iim42652/CMakeLists.txt b/src/drivers/imu/invensense/iim42652/CMakeLists.txt index a9e99a9efd..098bc6b600 100644 --- a/src/drivers/imu/invensense/iim42652/CMakeLists.txt +++ b/src/drivers/imu/invensense/iim42652/CMakeLists.txt @@ -34,7 +34,7 @@ px4_add_module( MODULE drivers__imu__invensense__iim42652 MAIN iim42652 COMPILE_FLAGS - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPACE} #-DDEBUG_BUILD SRCS iim42652_main.cpp diff --git a/src/drivers/imu/invensense/iim42653/CMakeLists.txt b/src/drivers/imu/invensense/iim42653/CMakeLists.txt index 4f0e7a7986..81a8ff23ec 100644 --- a/src/drivers/imu/invensense/iim42653/CMakeLists.txt +++ b/src/drivers/imu/invensense/iim42653/CMakeLists.txt @@ -34,7 +34,7 @@ px4_add_module( MODULE drivers__imu__invensense__iim42653 MAIN iim42653 COMPILE_FLAGS - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPACE} #-DDEBUG_BUILD SRCS iim42653_main.cpp diff --git a/src/examples/fake_imu/CMakeLists.txt b/src/examples/fake_imu/CMakeLists.txt index 2d037d7387..cf44b0a7c5 100644 --- a/src/examples/fake_imu/CMakeLists.txt +++ b/src/examples/fake_imu/CMakeLists.txt @@ -35,7 +35,7 @@ px4_add_module( MODULE modules__fake_imu MAIN fake_imu COMPILE_FLAGS - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPEED} SRCS FakeImu.cpp FakeImu.hpp diff --git a/src/lib/cdev/CMakeLists.txt b/src/lib/cdev/CMakeLists.txt index c4a7674be5..86ba98e3fe 100644 --- a/src/lib/cdev/CMakeLists.txt +++ b/src/lib/cdev/CMakeLists.txt @@ -49,7 +49,7 @@ px4_add_library(cdev CDev.hpp ${SRCS_PLATFORM} ) -target_compile_options(cdev PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(cdev PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) if (${PX4_PLATFORM} STREQUAL "nuttx") target_link_libraries(cdev PRIVATE nuttx_fs) # register/unregister driver diff --git a/src/lib/conversion/CMakeLists.txt b/src/lib/conversion/CMakeLists.txt index a3876dad88..2695a444dd 100644 --- a/src/lib/conversion/CMakeLists.txt +++ b/src/lib/conversion/CMakeLists.txt @@ -36,6 +36,6 @@ px4_add_library(conversion rotation.h ) -target_compile_options(conversion PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(conversion PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) px4_add_unit_gtest(SRC RotationTest.cpp LINKLIBS conversion) diff --git a/src/lib/crc/CMakeLists.txt b/src/lib/crc/CMakeLists.txt index f765caf557..6a2067f8b2 100644 --- a/src/lib/crc/CMakeLists.txt +++ b/src/lib/crc/CMakeLists.txt @@ -36,4 +36,4 @@ add_library(crc STATIC EXCLUDE_FROM_ALL crc.h ) add_dependencies(crc prebuild_targets) -target_compile_options(crc PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(crc PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) diff --git a/src/lib/drivers/accelerometer/CMakeLists.txt b/src/lib/drivers/accelerometer/CMakeLists.txt index 961c39f174..acef20af31 100644 --- a/src/lib/drivers/accelerometer/CMakeLists.txt +++ b/src/lib/drivers/accelerometer/CMakeLists.txt @@ -35,5 +35,5 @@ px4_add_library(drivers_accelerometer PX4Accelerometer.cpp PX4Accelerometer.hpp ) -target_compile_options(drivers_accelerometer PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(drivers_accelerometer PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) target_link_libraries(drivers_accelerometer PRIVATE conversion) diff --git a/src/lib/drivers/gyroscope/CMakeLists.txt b/src/lib/drivers/gyroscope/CMakeLists.txt index bb835cdc7b..e67a0ccbaa 100644 --- a/src/lib/drivers/gyroscope/CMakeLists.txt +++ b/src/lib/drivers/gyroscope/CMakeLists.txt @@ -35,5 +35,5 @@ px4_add_library(drivers_gyroscope PX4Gyroscope.cpp PX4Gyroscope.hpp ) -target_compile_options(drivers_gyroscope PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(drivers_gyroscope PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) target_link_libraries(drivers_gyroscope PRIVATE conversion) diff --git a/src/lib/geo/CMakeLists.txt b/src/lib/geo/CMakeLists.txt index 04c8eae037..eee38d84bf 100644 --- a/src/lib/geo/CMakeLists.txt +++ b/src/lib/geo/CMakeLists.txt @@ -36,6 +36,6 @@ add_library(geo geo.h ) add_dependencies(geo prebuild_targets) -target_compile_options(geo PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(geo PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) px4_add_unit_gtest(SRC test_geo.cpp LINKLIBS geo) diff --git a/src/lib/heatshrink/CMakeLists.txt b/src/lib/heatshrink/CMakeLists.txt index bd07dc8254..8de25788f7 100644 --- a/src/lib/heatshrink/CMakeLists.txt +++ b/src/lib/heatshrink/CMakeLists.txt @@ -38,5 +38,5 @@ px4_add_library(heatshrink ) target_compile_options(heatshrink PRIVATE - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPEED} -DHEATSHRINK_DYNAMIC_ALLOC=0) diff --git a/src/lib/mixer_module/CMakeLists.txt b/src/lib/mixer_module/CMakeLists.txt index 783dfe3dde..59d502bfe2 100644 --- a/src/lib/mixer_module/CMakeLists.txt +++ b/src/lib/mixer_module/CMakeLists.txt @@ -61,7 +61,7 @@ px4_add_library(mixer_module ) add_dependencies(mixer_module output_functions_header) -target_compile_options(mixer_module PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(mixer_module PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) target_include_directories(mixer_module PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) px4_add_functional_gtest(SRC mixer_module_tests.cpp LINKLIBS mixer_module) diff --git a/src/lib/parameters/CMakeLists.txt b/src/lib/parameters/CMakeLists.txt index b87e652cad..ea397f7c87 100644 --- a/src/lib/parameters/CMakeLists.txt +++ b/src/lib/parameters/CMakeLists.txt @@ -31,7 +31,7 @@ # ############################################################################ -add_compile_options(${MAX_CUSTOM_OPT_LEVEL}) +add_compile_options(${MAX_CUSTOM_OPT_LEVEL_SPEED}) if (NOT PARAM_DEFAULT_OVERRIDES) set(PARAM_DEFAULT_OVERRIDES "{}") @@ -157,7 +157,7 @@ add_custom_target(parameters_header DEPENDS px4_parameters.hpp) set(SRCS) list(APPEND SRCS - parameters.cpp + parameters.cpp atomic_transaction.cpp autosave.cpp ) diff --git a/src/lib/perf/CMakeLists.txt b/src/lib/perf/CMakeLists.txt index 18c9481181..30bced5126 100644 --- a/src/lib/perf/CMakeLists.txt +++ b/src/lib/perf/CMakeLists.txt @@ -33,4 +33,4 @@ add_library(perf perf_counter.cpp) add_dependencies(perf prebuild_targets) -target_compile_options(perf PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(perf PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) diff --git a/src/lib/rate_control/CMakeLists.txt b/src/lib/rate_control/CMakeLists.txt index f95b133eea..882cc96569 100644 --- a/src/lib/rate_control/CMakeLists.txt +++ b/src/lib/rate_control/CMakeLists.txt @@ -35,7 +35,7 @@ px4_add_library(RateControl rate_control.cpp rate_control.hpp ) -target_compile_options(RateControl PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(RateControl PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) target_include_directories(RateControl PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(RateControl PRIVATE mathlib) diff --git a/src/lib/systemlib/CMakeLists.txt b/src/lib/systemlib/CMakeLists.txt index 726fa7c074..ab9cf917fb 100644 --- a/src/lib/systemlib/CMakeLists.txt +++ b/src/lib/systemlib/CMakeLists.txt @@ -47,4 +47,4 @@ if(${PX4_PLATFORM} STREQUAL "nuttx") endif() px4_add_library(systemlib ${SRCS}) -target_compile_options(systemlib PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(systemlib PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) diff --git a/src/lib/tinybson/CMakeLists.txt b/src/lib/tinybson/CMakeLists.txt index 88febcd4f1..a40e94a9e3 100644 --- a/src/lib/tinybson/CMakeLists.txt +++ b/src/lib/tinybson/CMakeLists.txt @@ -39,7 +39,7 @@ target_compile_definitions(tinybson PRIVATE -DMODULE_NAME="tinybson") target_compile_options(tinybson PRIVATE -Wno-sign-compare # TODO: fix this - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPEED} ) add_dependencies(tinybson prebuild_targets) diff --git a/src/lib/world_magnetic_model/CMakeLists.txt b/src/lib/world_magnetic_model/CMakeLists.txt index 350eeb2d44..8301ac9037 100644 --- a/src/lib/world_magnetic_model/CMakeLists.txt +++ b/src/lib/world_magnetic_model/CMakeLists.txt @@ -53,7 +53,7 @@ add_library(world_magnetic_model geo_magnetic_tables.hpp ) add_dependencies(world_magnetic_model prebuild_targets) -target_compile_options(world_magnetic_model PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(world_magnetic_model PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) if(BUILD_TESTING) px4_add_unit_gtest(SRC test_geo_lookup.cpp LINKLIBS world_magnetic_model) diff --git a/src/modules/control_allocator/ActuatorEffectiveness/CMakeLists.txt b/src/modules/control_allocator/ActuatorEffectiveness/CMakeLists.txt index 2406b81bf8..490478e2ec 100644 --- a/src/modules/control_allocator/ActuatorEffectiveness/CMakeLists.txt +++ b/src/modules/control_allocator/ActuatorEffectiveness/CMakeLists.txt @@ -64,7 +64,7 @@ px4_add_library(ActuatorEffectiveness ActuatorEffectivenessRoverAckermann.cpp ) -target_compile_options(ActuatorEffectiveness PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(ActuatorEffectiveness PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) target_include_directories(ActuatorEffectiveness PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(ActuatorEffectiveness PRIVATE diff --git a/src/modules/control_allocator/CMakeLists.txt b/src/modules/control_allocator/CMakeLists.txt index 65872dc432..38082750ab 100644 --- a/src/modules/control_allocator/CMakeLists.txt +++ b/src/modules/control_allocator/CMakeLists.txt @@ -39,7 +39,7 @@ px4_add_module( MODULE modules__control_allocator MAIN control_allocator COMPILE_FLAGS - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPEED} STACK_MAIN 3000 SRCS diff --git a/src/modules/control_allocator/ControlAllocation/CMakeLists.txt b/src/modules/control_allocator/ControlAllocation/CMakeLists.txt index 4da638aac8..e2227da92c 100644 --- a/src/modules/control_allocator/ControlAllocation/CMakeLists.txt +++ b/src/modules/control_allocator/ControlAllocation/CMakeLists.txt @@ -39,7 +39,7 @@ px4_add_library(ControlAllocation ControlAllocationSequentialDesaturation.cpp ControlAllocationSequentialDesaturation.hpp ) -target_compile_options(ControlAllocation PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(ControlAllocation PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) target_include_directories(ControlAllocation PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(ControlAllocation PRIVATE mathlib) diff --git a/src/modules/ekf2/CMakeLists.txt b/src/modules/ekf2/CMakeLists.txt index 112b920ba2..8fd8bfb759 100644 --- a/src/modules/ekf2/CMakeLists.txt +++ b/src/modules/ekf2/CMakeLists.txt @@ -238,7 +238,7 @@ px4_add_module( MODULE modules__ekf2 MAIN ekf2 COMPILE_FLAGS - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPEED} -fno-associative-math #-DDEBUG_BUILD #-O0 diff --git a/src/modules/ekf2/EKF/lat_lon_alt/CMakeLists.txt b/src/modules/ekf2/EKF/lat_lon_alt/CMakeLists.txt index acd30f51f2..8e615f5fe6 100644 --- a/src/modules/ekf2/EKF/lat_lon_alt/CMakeLists.txt +++ b/src/modules/ekf2/EKF/lat_lon_alt/CMakeLists.txt @@ -38,6 +38,6 @@ add_library(lat_lon_alt add_dependencies(lat_lon_alt prebuild_targets) target_include_directories(lat_lon_alt PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) -target_compile_options(lat_lon_alt PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(lat_lon_alt PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) px4_add_unit_gtest(SRC test_lat_lon_alt.cpp LINKLIBS lat_lon_alt geo) diff --git a/src/modules/flight_mode_manager/tasks/AutoFollowTarget/follow_target_estimator/CMakeLists.txt b/src/modules/flight_mode_manager/tasks/AutoFollowTarget/follow_target_estimator/CMakeLists.txt index 0312ffcbd6..905a724e99 100644 --- a/src/modules/flight_mode_manager/tasks/AutoFollowTarget/follow_target_estimator/CMakeLists.txt +++ b/src/modules/flight_mode_manager/tasks/AutoFollowTarget/follow_target_estimator/CMakeLists.txt @@ -35,7 +35,7 @@ px4_add_library(follow_target_estimator TargetEstimator.cpp ) -target_compile_options(follow_target_estimator PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(follow_target_estimator PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) target_link_libraries(follow_target_estimator PRIVATE diff --git a/src/modules/fw_autotune_attitude_control/CMakeLists.txt b/src/modules/fw_autotune_attitude_control/CMakeLists.txt index 3c898a21ac..6562123fc9 100644 --- a/src/modules/fw_autotune_attitude_control/CMakeLists.txt +++ b/src/modules/fw_autotune_attitude_control/CMakeLists.txt @@ -35,7 +35,7 @@ px4_add_module( MODULE fw_autotune_attitude_control MAIN fw_autotune_attitude_control COMPILE_FLAGS - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPEED} SRCS fw_autotune_attitude_control.cpp fw_autotune_attitude_control.hpp diff --git a/src/modules/gyro_fft/CMakeLists.txt b/src/modules/gyro_fft/CMakeLists.txt index 9bf6832ed4..06adcc82ae 100644 --- a/src/modules/gyro_fft/CMakeLists.txt +++ b/src/modules/gyro_fft/CMakeLists.txt @@ -51,7 +51,7 @@ px4_add_module( STACK_MAIN 4096 COMPILE_FLAGS - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPEED} -DARM_ALL_FFT_TABLES -DARM_MATH_LOOPUNROLL INCLUDES diff --git a/src/modules/logger/CMakeLists.txt b/src/modules/logger/CMakeLists.txt index c75622e1d7..0879d0f651 100644 --- a/src/modules/logger/CMakeLists.txt +++ b/src/modules/logger/CMakeLists.txt @@ -37,7 +37,7 @@ px4_add_module( PRIORITY "SCHED_PRIORITY_MAX-30" STACK_MAIN 2500 COMPILE_FLAGS - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPEED} -Wno-cast-align # TODO: fix and enable SRCS logged_topics.cpp diff --git a/src/modules/mc_att_control/AttitudeControl/CMakeLists.txt b/src/modules/mc_att_control/AttitudeControl/CMakeLists.txt index 96c4561297..447c727f8e 100644 --- a/src/modules/mc_att_control/AttitudeControl/CMakeLists.txt +++ b/src/modules/mc_att_control/AttitudeControl/CMakeLists.txt @@ -36,7 +36,7 @@ px4_add_library(AttitudeControl AttitudeControl.hpp AttitudeControlMath.hpp ) -target_compile_options(AttitudeControl PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(AttitudeControl PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) target_include_directories(AttitudeControl PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) px4_add_unit_gtest(SRC AttitudeControlTest.cpp LINKLIBS AttitudeControl) diff --git a/src/modules/mc_att_control/CMakeLists.txt b/src/modules/mc_att_control/CMakeLists.txt index abd0f4ff9c..55a7168f51 100644 --- a/src/modules/mc_att_control/CMakeLists.txt +++ b/src/modules/mc_att_control/CMakeLists.txt @@ -37,7 +37,7 @@ px4_add_module( MODULE modules__mc_att_control MAIN mc_att_control COMPILE_FLAGS - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPEED} SRCS mc_att_control_main.cpp mc_att_control.hpp diff --git a/src/modules/mc_autotune_attitude_control/CMakeLists.txt b/src/modules/mc_autotune_attitude_control/CMakeLists.txt index 62dfc9ca3c..c70b697113 100644 --- a/src/modules/mc_autotune_attitude_control/CMakeLists.txt +++ b/src/modules/mc_autotune_attitude_control/CMakeLists.txt @@ -35,7 +35,7 @@ px4_add_module( MODULE mc_autotune_attitude_control MAIN mc_autotune_attitude_control COMPILE_FLAGS - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPEED} SRCS mc_autotune_attitude_control.cpp mc_autotune_attitude_control.hpp diff --git a/src/modules/mc_hover_thrust_estimator/CMakeLists.txt b/src/modules/mc_hover_thrust_estimator/CMakeLists.txt index 9504a18add..e082fd17ae 100644 --- a/src/modules/mc_hover_thrust_estimator/CMakeLists.txt +++ b/src/modules/mc_hover_thrust_estimator/CMakeLists.txt @@ -40,7 +40,7 @@ px4_add_module( MODULE modules__mc_hover_thrust_estimator MAIN mc_hover_thrust_estimator COMPILE_FLAGS - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPEED} SRCS MulticopterHoverThrustEstimator.cpp MulticopterHoverThrustEstimator.hpp diff --git a/src/modules/mc_rate_control/CMakeLists.txt b/src/modules/mc_rate_control/CMakeLists.txt index 849993e623..5896459f0a 100644 --- a/src/modules/mc_rate_control/CMakeLists.txt +++ b/src/modules/mc_rate_control/CMakeLists.txt @@ -35,7 +35,7 @@ px4_add_module( MODULE modules__mc_rate_control MAIN mc_rate_control COMPILE_FLAGS - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPEED} SRCS MulticopterRateControl.cpp MulticopterRateControl.hpp diff --git a/src/modules/sensors/vehicle_acceleration/CMakeLists.txt b/src/modules/sensors/vehicle_acceleration/CMakeLists.txt index 37f3558992..77ec3fb729 100644 --- a/src/modules/sensors/vehicle_acceleration/CMakeLists.txt +++ b/src/modules/sensors/vehicle_acceleration/CMakeLists.txt @@ -36,7 +36,7 @@ px4_add_library(vehicle_acceleration VehicleAcceleration.hpp ) -target_compile_options(vehicle_acceleration PRIVATE ${MAX_CUSTOM_OPT_LEVEL}) +target_compile_options(vehicle_acceleration PRIVATE ${MAX_CUSTOM_OPT_LEVEL_SPEED}) target_link_libraries(vehicle_acceleration PRIVATE diff --git a/src/modules/sensors/vehicle_angular_velocity/CMakeLists.txt b/src/modules/sensors/vehicle_angular_velocity/CMakeLists.txt index 8ab38d47bd..7e0f9235b4 100644 --- a/src/modules/sensors/vehicle_angular_velocity/CMakeLists.txt +++ b/src/modules/sensors/vehicle_angular_velocity/CMakeLists.txt @@ -38,7 +38,7 @@ px4_add_library(vehicle_angular_velocity target_compile_options(vehicle_angular_velocity PRIVATE - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPEED} #-DDEBUG_BUILD ) diff --git a/src/modules/sensors/vehicle_imu/CMakeLists.txt b/src/modules/sensors/vehicle_imu/CMakeLists.txt index fe6ddeb8a4..dbbe52a513 100644 --- a/src/modules/sensors/vehicle_imu/CMakeLists.txt +++ b/src/modules/sensors/vehicle_imu/CMakeLists.txt @@ -38,7 +38,7 @@ px4_add_library(vehicle_imu target_compile_options(vehicle_imu PRIVATE - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPEED} #-DDEBUG_BUILD ) diff --git a/src/modules/simulation/gz_bridge/CMakeLists.txt b/src/modules/simulation/gz_bridge/CMakeLists.txt index a094298fab..31a6a835d7 100644 --- a/src/modules/simulation/gz_bridge/CMakeLists.txt +++ b/src/modules/simulation/gz_bridge/CMakeLists.txt @@ -51,7 +51,7 @@ if(gz-transport_FOUND) MODULE modules__simulation__gz_bridge MAIN gz_bridge COMPILE_FLAGS - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPEED} SRCS GZBridge.cpp GZBridge.hpp diff --git a/src/modules/simulation/simulator_sih/CMakeLists.txt b/src/modules/simulation/simulator_sih/CMakeLists.txt index f0328024ff..bb8eaf435b 100644 --- a/src/modules/simulation/simulator_sih/CMakeLists.txt +++ b/src/modules/simulation/simulator_sih/CMakeLists.txt @@ -35,7 +35,7 @@ px4_add_module( MODULE modules__simulation__simulator_sih MAIN simulator_sih COMPILE_FLAGS - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPEED} SRCS aero.hpp sih.cpp diff --git a/src/modules/uxrce_dds_client/CMakeLists.txt b/src/modules/uxrce_dds_client/CMakeLists.txt index ed6c576fe5..95af0173f1 100644 --- a/src/modules/uxrce_dds_client/CMakeLists.txt +++ b/src/modules/uxrce_dds_client/CMakeLists.txt @@ -138,7 +138,7 @@ else() COMPILE_FLAGS #-O0 # -DDEBUG_BUILD - ${MAX_CUSTOM_OPT_LEVEL} + ${MAX_CUSTOM_OPT_LEVEL_SPEED} SRCS ${CMAKE_CURRENT_BINARY_DIR}/dds_topics.h uxrce_dds_client.cpp