Pods project - enabling optimization of the entire module

In Xcode 9, I get the following sentence for the cocoa pods project: sentence

What is he doing? And, will I turn it on, or will it break things?

+4
source share
2 answers

Using optimization of the entire module allows the compiler to view all the source files in the module. This makes compilation slower, but allows you to optimize common functions, even if they are located in a separate source files. You can see this in the last test run, where the runtime is now the same for defining local and external functions.

In general, if you don't mind the extra compilation time, try turning it on to optimize the entire module for your release versions.

0

pods install, post_install script Podfile.

    post_install do |installer| 
      installer.pods_project.build_configurations.each do |config|
        if config.name == 'Release'
          config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = '-Owholemodule'
        else
          config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = '-Onone'
        end    
      end
    end
+1

Source: https://habr.com/ru/post/1687406/


All Articles