Skip to content

Instantly share code, notes, and snippets.

@pofat
Created February 16, 2020 14:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pofat/c8ad79f28fd58d824a906d01bd5ceb58 to your computer and use it in GitHub Desktop.
Save pofat/c8ad79f28fd58d824a906d01bd5ceb58 to your computer and use it in GitHub Desktop.
Turn your pods into statically linked
# Add these in your Podfile (available for CocoaPods v1.7.x+)
# Replace with any Pods that you want to keep dynamically linked
keep_dynamically_linked = ['RxCocoa', 'RxSwift']
target 'YourApp' do
# all you pods here...
end
pre_install do |installer|
puts "Make pods linked statically except reserved pods"
installer.pod_targets.each do |pod|
if !keep_dynamically_linked.include?(pod.name)
puts "Override the static_framework? method for #{pod.name}"
def pod.build_type;
Pod::Target::BuildType.static_framework
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment