How does build order of source files are decided by compiler?
Hi all,
I am using STM32F042 series mcu, and IAR as compiler.
I have some #define statements in main.h which provides some setting configurations. Forexample we have different custom pcbs which have either active low or active high button. If I place #define active_high it compiles button.c source file accordingly.
However, I noticed that some of my source files are built before main.c is builded. This causes my #define statements are not recognised by these source files. The simple way to solve this problem can be including main.h in each source file, but I want to learn how compiler decides order of source files which will be builded. Does anyone have any idea?
Is it possible to select main.c to be builded first?
Thanks in advance.
