dcariola / XCodeEditor-for-Unity

XCode 4 project editor for Unity3D postprocess.
MIT License
217 stars 101 forks source link

Add Compiler Flag? #15

Open robochase6000 opened 9 years ago

robochase6000 commented 9 years ago

I noticed this function in PBXBuildFile.cs public bool AddCompilerFlag( string flag )

and I've spent the better part of a day trying to figure out how to use XCodeEditor-for-Unity to add a compile flag to a list of files, but I'm not sure about the best way to do it.

What is the preferred way to do it? Sorry if this isn't the best channel to ask this question.

robochase6000 commented 9 years ago

Well, I was able to figure this out.

If anyone stumbles upon this, my solution was to have PBXBuildFile hang onto the PBXFileReference that's passed into the constructor. Then, when you're applying the XcMod, you look through the list of buildFiles and compare its PBXFileReference's file name to whatever file name you want to add the compiler flag to, and call AddCompilerFlag on it.