If you're looking for a premade solution you may be interested in neopo, an unofficial toolchain management utility compatible with Particle Workbench and Particle CLI projects that I maintain.
Neopo makes it incredibly simple to download and use the Particle toolchains to locally create, build, and flash Particle projects while providing many additional features. (It also facilitates the usage of Particle Workbench on unsupported Linux distributions.)
The following is an example of using neopo to create a project, set EXTRA_CFLAGS, and then build the project, downloading toolchains on the fly if necessary:
Thanks for the tip @nrobinson2000. I’ll give neopo a look, but looks like setting that env var might be just the ticket for the small compile-time flags I wish to set.