Skip to content

Commit

Permalink
fix missing -objc for xcframeworks - take 2
Browse files Browse the repository at this point in the history
  • Loading branch information
paulb777 committed Jul 2, 2021
1 parent 84d8154 commit de0360b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 33 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -24,6 +24,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`

##### Bug Fixes

* Fix missing `-ObjC` for static XCFrameworks - take 2
[Paul Beusterien](https://github.com/paulb777)
[#10459](https://github.com/CocoaPods/CocoaPods/issuess/10459)

* Change URL validation failure to a note
[Paul Beusterien](https://github.com/paulb777)
[#10291](https://github.com/CocoaPods/CocoaPods/issues/10291)
Expand Down
4 changes: 2 additions & 2 deletions lib/cocoapods/sandbox/file_accessor.rb
Expand Up @@ -167,7 +167,7 @@ def vendored_frameworks
# that come shipped with the Pod.
#
def vendored_dynamic_frameworks
(vendored_frameworks - vendored_xcframeworks).select do |framework|
vendored_frameworks.select do |framework|
Xcode::LinkageAnalyzer.dynamic_binary?(framework + framework.basename('.*'))
end
end
Expand All @@ -176,7 +176,7 @@ def vendored_dynamic_frameworks
# bundles that come shipped with the Pod.
#
def vendored_static_frameworks
vendored_frameworks - vendored_dynamic_frameworks - vendored_xcframeworks
vendored_frameworks - vendored_dynamic_frameworks
end

# @return [Array<Pathname>] The paths of vendored .xcframework bundles
Expand Down
16 changes: 0 additions & 16 deletions lib/cocoapods/target/build_settings.rb
Expand Up @@ -1263,24 +1263,8 @@ def other_swift_flags_without_swift?
end
end

# @return [Boolean]
define_build_settings_method :any_vendored_static_xcframeworks?, :memoized => true do
pod_targets.any? do |pt|
pt.build_settings.any? do |bs|
if bs.respond_to?(:vendored_xcframeworks)
bs.vendored_xcframeworks.any? do |xcf|
xcf.build_type == BuildType.static_framework
end
end
end
end
end

# @return [Boolean]
define_build_settings_method :any_vendored_static_artifacts?, :memoized => true do
if any_vendored_static_xcframeworks?
return true
end
pod_targets.any? do |pt|
pt.file_accessors.any? do |fa|
!fa.vendored_static_artifacts.empty?
Expand Down
16 changes: 1 addition & 15 deletions spec/unit/target/build_settings_spec.rb
Expand Up @@ -352,19 +352,13 @@ def aggregate(aggregate_target, configuration_name = 'Release')
file_accessor = stub('file_accessor',
:spec => spec,
:spec_consumer => consumer,
:vendored_static_artifacts => [],
:vendored_static_artifacts => [1, 2, 3],
:vendored_static_libraries => [],
:vendored_dynamic_libraries => [],
:vendored_static_frameworks => [],
:vendored_dynamic_frameworks => [],
:vendored_xcframeworks => [],
)
vendored_xcframework = stub('vendored_xcframework',
:build_type => BuildType.static_framework,
)
build_setting = stub('build_setting',
:vendored_xcframeworks => [vendored_xcframework],
)
pod_target = stub('pod_target',
:any_vendored_static_artifacts? => true,
:file_accessors => [file_accessor],
Expand All @@ -377,7 +371,6 @@ def aggregate(aggregate_target, configuration_name = 'Release')
:spec_consumers => [consumer],
:build_as_static? => false,
:build_as_dynamic? => false,
:build_settings => [build_setting],
:product_basename => 'PodTarget',
:target_definitions => [target_definition],
:root_spec => spec,
Expand Down Expand Up @@ -407,12 +400,6 @@ def aggregate(aggregate_target, configuration_name = 'Release')
:vendored_dynamic_frameworks => [],
:vendored_xcframeworks => [],
)
vendored_xcframework = stub('vendored_xcframework',
:build_type => BuildType.dynamic_framework,
)
build_setting = stub('build_setting',
:vendored_xcframeworks => [vendored_xcframework],
)
pod_target = stub('pod_target',
:any_vendored_static_artifacts? => true,
:file_accessors => [file_accessor],
Expand All @@ -425,7 +412,6 @@ def aggregate(aggregate_target, configuration_name = 'Release')
:spec_consumers => [consumer],
:build_as_static? => false,
:build_as_dynamic? => false,
:build_settings => [build_setting],
:product_basename => 'PodTarget',
:target_definitions => [target_definition],
:root_spec => spec,
Expand Down

0 comments on commit de0360b

Please sign in to comment.