Achieving a preprocessor in Xcode 9?

Viewed 246

How, really, would you mod Xcode to include preprocessing on all scripts - in modern Xcode (ie 9+)?

Obviously this was trivial in the Old Days.

Would one basically be using a custom build rule ?

.

enter image description here

.

Or perhaps, would you need basically "A Mac App" which runs (how?) before the compile?

1 Answers

It depends on what you want the preprocessor to do. Assuming that the output files are regular .c, .m, .cpp etc. files that the compiler can handle correctly then you could simply add a new 'Run Script' build phase to run your pre-processor. It has access to the Xcode environment variables so should be able to run effectively. As Nik Kit said though, it depends on exactly what you want to achieve.

Related