How to use a particular specified native toolchain?

@valeros @vit

I know this is an old thread, but I figured out a way to do this. Posting since I found this while looking for a solution.

In platformio.ini:

[env:native_custom_gcc]
platform = native
extra_scripts = pre:modify_path.py
...

Then create a python script modify_path.py in your working directory:

import os 

os.environ["path"] += "C:/path/to/gcc/"

This will let the platformio find gcc in that directory without modifying your system path. If there is another gcc on path you might need to change this a little so this path is added to the beginning instead of the end of your path.