Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Remove static lib dependencies when the user project for a CocoaPods is an static lib project itself
# we don't want to link static libs or it will fail to build
# see
targets = [:target1, :target2]
lib_dependencies = ['z']
post_install do |installer| { |i| targets.include? }.each do |l|
config_file_path = l.library.xcconfig_path
config_file_contents =
lib_dependencies.each { |dep| config_file_contents.gsub!(/ -l#{dep}/, '') }, 'w') { |file| file.write config_file_contents }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment