Changing XCode build settings from Introjucer


#1

Same problem I’ve had for a very long time now… the XCode build settings that the Introjucer spits out aren’t what I need, but there seems to be no way to change this.

To be specific, go to the project.pbxproj generated by Xcode, scroll down to close to the bottom, and look for sections containing “isa = XCBuildConfiguration;” - the current Jucer spits out four of them, two Debug and two Release, and one Debug and one Release section have compiler and build options.

I need to have values different from those that Juce generates. The libraries I am using have a different external linkage for the STL than the default, and while everything works, I get over one thousand errors when I link, unless I change the build settings. (Plus, I like to turn on more warnings than the default.)

Before, I simply hacked the Introjucer and rebuilt it with my options. :smiley: This is a bit of a drag, but works - except I have to do it each time I update Juce. I’m off to do this now with the new modules branch, but I’d love to find a more permanent solution.

I’m wondering if the “Custom PList” field might do this, but I doubt it on reading the code, and I frankly don’t understand it.


#2

(No, the custom plist is just for generating the .plist file that goes in the bundle, it has no effect on building).

I’m not clear on what it is that you need it to do differently for it to work…? Maybe if you let me know what your introjucer hacks were, I could come up with a way to turn them into an option?


#3

My dreadful hack follows. :smiley: It’s a change to jucer_ProjectExport_XCode.h.

The original code is hidden with an #if 0 - the hack is in the #else.

[code] StringArray getProjectSettings (const BuildConfiguration& config)
{
StringArray s;
#if 0
s.add (“ALWAYS_SEARCH_USER_PATHS = NO”);
s.add (“GCC_C_LANGUAGE_STANDARD = c99”);
s.add (“GCC_WARN_ABOUT_RETURN_TYPE = YES”);
s.add (“GCC_WARN_CHECK_SWITCH_STATEMENTS = YES”);
s.add (“GCC_WARN_UNUSED_VARIABLE = YES”);
s.add (“GCC_WARN_MISSING_PARENTHESES = YES”);
s.add (“GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES”);
s.add (“GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES”);
s.add (“WARNING_CFLAGS = -Wreorder”);
s.add (“GCC_MODEL_TUNING = G5”);

    if (projectType.isLibrary())
    {
        s.add ("GCC_INLINES_ARE_PRIVATE_EXTERN = NO");
        s.add ("GCC_SYMBOLS_PRIVATE_EXTERN = NO");
    }
    else
    {
        s.add ("GCC_INLINES_ARE_PRIVATE_EXTERN = YES");
    }

    if (iOS)
    {
        s.add ("\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\" = \"iPhone Developer\"");
        s.add ("SDKROOT = iphoneos");
        s.add ("TARGETED_DEVICE_FAMILY = \"1,2\"");
    }

    s.add ("ZERO_LINK = NO");

    if (xcodeCanUseDwarf)
        s.add ("DEBUG_INFORMATION_FORMAT = \"dwarf\"");

    s.add ("PRODUCT_NAME = \"" + config.getTargetBinaryName().toString() + "\"");

#else
s.add(“ALWAYS_SEARCH_USER_PATHS = NO”);
s.add(“DEAD_CODE_STRIPPING = YES”);
s.add(“DEBUG_INFORMATION_FORMAT = dwarf”);
s.add(“GCC_AUTO_VECTORIZATION = YES”);
s.add(“GCC_C_LANGUAGE_STANDARD = c99”);
s.add(“GCC_DEBUGGING_SYMBOLS = full”);
s.add(“GCC_DYNAMIC_NO_PIC = YES”);
s.add(“GCC_ENABLE_FIX_AND_CONTINUE = YES”);
s.add(“GCC_ENABLE_SSE3_EXTENSIONS = YES”);
s.add(“GCC_ENABLE_SSE41_EXTENSIONS = YES”);
s.add(“GCC_ENABLE_SSE42_EXTENSIONS = YES”);
s.add(“GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES”);
s.add(“GCC_FAST_MATH = YES”);
s.add(“GCC_INCREASE_PRECOMPILED_HEADER_SHARING = YES”);
s.add(“GCC_INLINES_ARE_PRIVATE_EXTERN = NO”);
s.add(“GCC_MODEL_TUNING = G5”);
s.add(“GCC_OPTIMIZATION_LEVEL = 0”);
s.add(“GCC_SYMBOLS_PRIVATE_EXTERN = NO”);
s.add(“GCC_UNROLL_LOOPS = YES”);
s.add(“GCC_WARN_64_TO_32_BIT_CONVERSION = YES”);
s.add(“GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES”);
s.add(“GCC_WARN_ABOUT_MISSING_NEWLINE = YES”);
s.add(“GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES”);
s.add(“GCC_WARN_ABOUT_RETURN_TYPE = YES”);
s.add(“GCC_WARN_CHECK_SWITCH_STATEMENTS = YES”);
s.add(“GCC_WARN_EFFECTIVE_CPLUSPLUS_VIOLATIONS = NO”);
s.add(“GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES”);
s.add(“GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO”);
s.add(“GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES”);
s.add(“GCC_WARN_MISSING_PARENTHESES = YES”);
s.add(“GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES”);
s.add(“GCC_WARN_PROTOTYPE_CONVERSION = YES”);
s.add(“GCC_WARN_SHADOW = NO”);
s.add(“GCC_WARN_SIGN_COMPARE = YES”);
s.add(“GCC_WARN_STRICT_SELECTOR_MATCH = YES”);
s.add(“GCC_WARN_TYPECHECK_CALLS_TO_PRINTF = YES”);
s.add(“GCC_WARN_UNDECLARED_SELECTOR = YES”);
s.add(“GCC_WARN_UNINITIALIZED_AUTOS = NO”);
s.add(“GCC_WARN_UNKNOWN_PRAGMAS = YES”);
s.add(“GCC_WARN_UNUSED_FUNCTION = YES”);
s.add(“GCC_WARN_UNUSED_LABEL = YES”);
s.add(“GCC_WARN_UNUSED_VARIABLE = YES”);
s.add("PRODUCT_NAME = “SlowGold 8"”);
s.add(“STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = static”);
s.add(“WARNING_CFLAGS = “-Wreorder””);
s.add(“ZERO_LINK = NO”);

#endif[/code]


#4

I think you should be able to add all those build settings in the new “Custom Xcode flags” box…


#5

That sounds right!

I just found out we’re back on the head again, so I’ll update and check it out today or tomorrow…)