I am building a new Xcode project template and I want to include a library that is non-ARC. But my whole project is ARC, so the only way how to build the project is to specify a compiler flag (-fno-objc-arc
) on the files from that library.
How do I do that in an Xcode project template?
I tried setting it on specific files in the Definitions
dictionary, both as COMPILER_FLAG and CompilerFlag. Neither of them works.
I have found absolutely no documentation on this, but I am pretty sure it can be done.
UPDATE:
Apple replied to my support request stating that there is no way of doing that right now. So unfortunately, we are out of luck, until they finally do something about the templates and their documentation.
UPDATE 2:
I've got an idea how to hack this a little bit by using a build phases script, that will check the Xcode project and add the required flags. I will post an answer soon.