sharing this in case anyone needs a more advanced solution than https://gist.github.com/patriciogonzalezvivo/9a50569c2ef9b08058706443a39d838e:
here's my modified pcpp to make it work better with lygia.
features:
- depfile, so your favorite build system recognizes when to trigger a rebuild
 
- optionally (toggle with 
--passthru) expands preprocessor directives 
- ignores unnecessary 
#includes (i.e. "tree-shaking" or "dead code elimination") 
pcpp-1.30.tar.gz
5d1004907f0aa61547b31d55cb4f97ae691c5bbfbcc7be25ce585766d167cf16  pcpp-1.30.tar.gz
you can also plug this alongside something like shader-minifier or cembed for use in c/c++ source.