Skip to content

Commit

Permalink
fix: libtool error due to missing arch
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwcg committed Jan 16, 2024
1 parent 8d05500 commit d7cb202
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/cocoapods-packager/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ def build_static_library_for_ios(output)
static_libs = static_libs_in_sandbox('build') + static_libs_in_sandbox('build-sim') + vendored_libraries
libs = ios_architectures.map do |arch|
library = "#{@static_sandbox_root}/build/package-#{arch}.a"
`libtool -arch_only #{arch} -static -o #{library} #{static_libs.join(' ')}`
library
end

`libtool -arch_only #{arch} -static -o #{library} #{static_libs.join(' ')} 2> /dev/null`
library if File.exist?(library)
end.compact
`lipo -create -output #{output} #{libs.join(' ')}`
end

Expand Down Expand Up @@ -290,7 +290,7 @@ def vendored_libraries
libs = file_accessors.flat_map(&:vendored_static_frameworks).map { |f| f + f.basename('.*') } || []
libs += file_accessors.flat_map(&:vendored_static_libraries)
@vendored_libraries = libs.compact.map(&:to_s)
puts "Final vendored libraries: #{@vendored_libraries}"
puts "Vendored libraries: #{@vendored_libraries}"

@vendored_libraries
end
Expand Down

0 comments on commit d7cb202

Please sign in to comment.