How to add build option for xcode in Projucer


#1

I have a file in my project that needs to be compiled as C++ in Windows and Obj-C++ in OSX. It’s easy enough to do this in XCode IDE–setting the one .cpp file to be compiled as Obj-C++ rather than as default.

That causes the following to be added in project.pbxproj for the file:
explicitFileType = sourcecode.cpp.objcpp
so the line in project.pbcproj reads
99767A026B08541051B54C99 /* SendKeys.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; name = SendKeys.cpp; path = ../../Source/SendKeys.cpp; sourceTree = SOURCE_ROOT; };

But that will be overwritten every time I regenerate the Juce project. Is there an option in Projucer for the Export target: XCode that will cause this change to be persistent?


#2

We have the same thing in lots of juce files, and just handle it by having a .mm file that includes the cpp file. Always simpler to fix things in the source files rather than build-settings if you can.