STMCubeIDE how to change the order of the includes

129 views Asked by At

I have userspace STM32 MPU project. There are some toolchain defined include paths and some added by me. I want my one to be scanned before the "standard ones"

Is it archivable in this IDE?

Example - I want to move the uapi/linux one above the toolchain one:

enter image description here

Of course, I know how to add additional include paths, but those which come from the toolchain (or more generally from MPU SDK are not there): enter image description here

Simply I want to swap the order of search (project include paths to be searched first): enter image description here

for those who like gernerated command lines:

 arm-ostl-linux-gnueabi-gcc  -mthumb -mfpu=neon-vfpv4 -mfloat-abi=hard -mcpu=cortex-a7 --sysroot=/home/piotr/.eclipse/com.st.stm32cube.ide.mcu.rcp.product_1.12.1_139061331_linux_gtk_x86_64/plugins/com.st.openstlinux.sdk.openstlinux_5.15_kirkstone_mp1_22_11_23_5.15.0.202301131307/tools/sysroots/cortexa7t2hf-neon-vfpv4-ostl-linux-gnueabi "../misc/ss.c" -std=gnu11 -g3 -D_GNU_SOURCE -c -I"/home/piotr/STM32CubeIDE/workspace_1.12.1/stm32MP157F-DK2-DEV/CA7/iproute/include" -I"/home/piotr/STM32CubeIDE/workspace_1.12.1/stm32MP157F-DK2-DEV/CA7/iproute/vdpa/include/uapi/linux" -Og -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"misc/ss.d" -MT"misc/ss.o" -o "misc/ss.o"
1

There are 1 answers

4
the busybee On

You want to prepend your include files before the system's include file. For this, you need to switch off the search of the system directories:

enter image description here

In consequence, you need to add all necessary system header files manually as you added the others header files. Set the order to your liking.

Note: It seems like a brittle software design if you need to replace system definitions with your own.