PlatformIO Community

Ignoring build for native platform

I’ve implemented native testing in PlatformIO inside my .ini file, but now when i press the tick to build, i appear to be building for both the micro-controller and the native environment, which fails to build.

This is my current setup:

;
; Embedded platform
;
[env:teensy40]
 platform = teensy
 board = teensy40
 framework = arduino
 monitor_speed = 115200
 build_flags =
   -D RELEASE

;
; Desktop platforms (Win, Mac, Linux, Raspberry Pi, etc.)
; Used for testing hyperloop system locally
;
[env:native]
 platform = native
 test_ignore = Mbed_*
 test_build_project_src = true
 build_flags =
    -std=c++17

How can i change the .ini file so that when i build all, the native environment is not built too?

Just set

[platformio]
default_envs = teensy40

per docs or use the build button for that specific environment in VSCode and not “Build all”.