I have a different issue. It is clear based on the output that Particle-CLI builds are using gcc and Make.. But that is all occuring inside Particle-CLI as a wrapper. If I am using Make from the outside to run Particle compile - how can I pass defines etc to the build ?
Also the build is actually taking place in the src directory - not the directory I am in when I invoke particle compile. This poses a problem because all the file names in errors and warnings are relative to the src directory, not the project directory.
That completely screws up any automated or other tools that work off the output of the compile as all the paths are wrong.
Normally in Vime I can find and error in the listing and type "gf" to open the file that had the error in it. There are other tools that will take me to the line with the error.
None of this works with particle compile because the compile does not take place in the project directory.
We do not recommend attempting to build source in arbitrary directories. You would need to modify the Device OS Makefile for the user binary in order to do that. Using src, including subdirectories of src and pseudo libraries is the recommended method.
To modify CFLAGS, you can add a build.mk file in the src directory (not the top level!) and append your flags.