PlatformIO Build System is based on SCons tool. SCons doesn’t provide this information because it is buid system (not compiler). Nevertheless, you can resolve it with extra_script.
The full process should look like:
- Create extra script for PlatformIO Build System
- Get a list with build files
- Run
gcc -fpreprocessed -E -dMon each file - Parse defines
Here is explanation how to list all files that are going to be built https://bitbucket.org/scons/scons/wiki/FindTargetSources
This approach requires Python and SCons skills. I even don’t know how to explain in a few words how to resolve it.
SCons is build tool/framework (Python-based alternative to make/cmake). We created own cross-platform super-fast Build System with automatic Library Dependecy Finder for development platforms . Here is source code and development platforms.