SWIFT_WHOLE_MODULE_OPTIMIZATION - is it officially supported?

Hi, there are plenty of blog posts on the internet about how adding the user defined flag SWIFT_WHOLE_MODULE_OPTIMIZATION=YES can significantly reduce the build time of an application. I couldn't find an offical Apple documentation about this though. Can someone point me so I can be confident about adding that on my current app?


Thank you,

Replies

In the current version of Xcode, you should specify whole module optimization in the build settings. IIRC, it was recently changed to be a separate setting ("Compilation Mode"), rather than being one of the actual optimizer settings ("Optimization Level"). If you're using an older version of Xcode, it might still be specified as an Optimization Level, so you'll have to figure out the right approach by examining your settings.