micro_ros_stm32cubemx_utils
micro_ros_stm32cubemx_utils copied to clipboard
Building library with optimization
Hi! I'm trying to build libmicroros.a with enabled optimization (-O3) for use with STM32CubeIDE. I didn't understand how to properly pass desired flag into the build environment, so I modified extract_flags.py instead:
if len(optimization):
out = out + " " + "-O3"
-O3 flag shows in the building log (with unmodified extract_flags.py there's -O0). Build finishes successfully, but the libmicroros.a size is exactly the same as for the unoptimized build. So the question is how to properly build the library with the optimization enabled. Thanks!
Add the optimization flags to the cross compilation toolchain: https://github.com/micro-ROS/micro_ros_stm32cubemx_utils/blob/iron/microros_static_library/library_generation/toolchain.cmake