Getting the IDE to cooperate with a cross platform build that builds on PCs too

I’ve got my code compiling for Arduino 8-bit ATmega2560s, ESP32, ESP8266, Linux PCs, Windows PCs and Mac PCS. That’s not the problem. The problem is, including a platform.ini file makes PlatformIO basically take over my compiler and build tasks such that it always sets the compile constants as indicated by the platformio.ini. So ARDUINO is defined in the IDE even if I’m building for a PC currently. This doesn’t effect the actual build, because my tasks.json is setup to allow me to do traditional builds with gcc and such. During the build, the compile constants are correct.

I’d like a way to suspend the platform IO extension in my workspace so I don’t get a bunch of false source errors when I’m browsing code in the IDE

What I would like maybe as a workaround, is a platform and “board manager” for a desktop PC that doesn’t add a bunch of conditional defines to the build the IDE displays like #define ARDUINO

I hope that makes sense.

Well PlatformIO does support using the “native” platform (Native — PlatformIO latest documentation) that uses the available compiler of the OS, so that can also be unified in PlatformIO.

Development Platforms — PlatformIO latest documentation also has other desktop environments.

Otherwise I don’t think you can prevent the PlatformIO extension from acting when there is a folder open that has a platformio.ini. The extension has the setting “Activate Only on PlatformIO project” but that just changes it from “always activate” to “only activate when platformio.ini is there”, so it doesn’t help much.

Thanks so much! I was not using the right search strings apparently. I didn’t look for native.