Build Process Ordering

I’m trying to move Mav2Duplex that I forked into PlatformIO. I’m having an issue building this code because of a check for a define that is now occurring out of order. The following code trips the #error directive:

#if defined(__AVR_ATmega328P__)

// disable the stock Arduino serial driver
#ifdef HardwareSerial_h
# error Must include disableserial.h before the Arduino serial driver is defined.
#endif
#define HardwareSerial_h


#endif

How do I control the build process so this doesn’t fail? lib_ldf_mode = off doesn’t solve this. Thanks!

I know what the issue is and that’s .ino to .cpp conversion. I’m fine w. making my own cpp files and using src_filter to omit the ino files. However, I would like to see the converted file so I can see what’s going on in the background. Where are they? Thanks!

Could you provide a simple project to reproduce this issue?

I was able to resolve my issue. I just created two symlinks from the .ino files to .cpp “files”. I then used src_filter to omit the ino files. Thanks!