Search code examples
c++xcodeoptimizationcompilationrelease-mode

What optimizations / settings should I use for compiling in release mode in Xcode for MacOS?


I have an app I am working on that will be used in MacOS with Adobe products.

The SDK only comes with a debug release mode for the projects. If I try to edit the scheme and look under 'run', I cannot switch it to release as there is no other option either than debug. From what I've read, this means I either have to create a new scheme, or edit this one.

In Windows, compiling between debug and release mode produces a huge performance difference in the app so I assume the same thing happens in MacOS. For this reason, it is important for me to set the appropriate optimizations correctly. However, I have no idea which are important.

Does anyone have suggestions on what are the key optimizations I should set by either editing the debug mode, or creating a new one, for optimal performance from my app?

Thank you - I am a little blind in this department as I am a Windows developer and Mac is new to me.

Thanks, -Richard


Solution

  • To create a new scheme:

    1. Get the screen looking like the following screenshot:

    enter image description here

    1. Click on '+' under where it says AppStore. This creates a duplicate of an existing scheme with a new name.

    2. Edit the newly created configuration with the desired compiler settings etc.

    The newly created configuration should then show up in the 'Edit Schemes' window.


    Edit: To set optimisation flags, get your screen looking like this and then select the flags you want for each configuration:

    Set optimisation flags

    I encourage you to experiment. None of this is difficult.