Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When use xcframework a link is created in OTHER_LDFLAGS #12284

Open
1 task done
priore opened this issue Feb 17, 2024 · 0 comments
Open
1 task done

When use xcframework a link is created in OTHER_LDFLAGS #12284

priore opened this issue Feb 17, 2024 · 0 comments

Comments

@priore
Copy link

priore commented Feb 17, 2024

Report

What did you do?

Run pod install

What did you expect to happen?

Install xcframework without linking a static framework in OTHER_LDFLAGS.

OTHER_LDFLAGS = $(inherited) -l"xml2" -framework "Accounts" -framework "Security"

What happened instead?

A static framework link was created in OTHER_LDFLAGS, this is wrong why the xcode tries to compile but reports the error "framework 'SOAPEngine' not found"

OTHER_LDFLAGS = $(inherited) -l"xml2" -framework "Accounts" -framework "Security" -framework "SOAPEngine"

and I had to use a script in the pod file to remove it, see post_install which is now commented out/disabled.

CocoaPods Environment

Stack

   CocoaPods : 1.15.2
        Ruby : ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin23]
    RubyGems : 3.4.22
        Host : macOS 14.3.1 (23D60)
       Xcode : 15.2 (15C500b)
         Git : git version 2.39.3 (Apple Git-145)
Ruby lib dir : /opt/homebrew/Cellar/ruby/3.2.2_1/lib
Repositories : cocoapods - git - https://github.com/CocoaPods/Specs.git @ 9c3fa56a759cfa8f281a303b9d035a079b8a582a
               trunk - CDN - https://cdn.cocoapods.org/

Installation Source

Executable Path: /opt/homebrew/opt/ruby/bin/pod

Plugins

cocoapods-deintegrate : 1.0.5
cocoapods-plugins     : 1.0.0
cocoapods-pod-linkage : 0.0.1
cocoapods-search      : 1.0.1
cocoapods-trunk       : 1.6.0
cocoapods-try         : 1.2.0

Podfile

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'SOAPTest' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for SOAPTest
  pod 'SOAPEngine', :podspec => '~/Desktop/SOAPTest/SOAPEngine/SOAPEngine.podspec'

end
#
# remove -framework SOAPEngine with script
#
#post_install do |installer|
#    installer.pods_project.targets.each do |target|
#        target.build_configurations.each do |config|
#            xcconfig_path = config.base_configuration_reference.real_path
#            xcconfig = File.read(xcconfig_path)
#            xcconfig_mod = xcconfig.gsub(/-framework "SOAPEngine"/, "")
#            File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
#        end
#    end
#end

Podspec

Pod::Spec.new do |s|
  s.name 					= 'SOAPEngine'
  s.version 				= '1.43'
  s.summary 				= 'This generic SOAP client allows you to access web services using a your iOS and Mac OS X app.'
  s.license 				= { :type => 'MIT', :file => 'LICENSE.txt' }
  s.authors 				= { 'Danilo Priore' => 'support@prioregroup.com' }
  s.homepage 				= 'https://github.com/priore/SOAPEngine'
  s.social_media_url 		= 'https://twitter.com/danilopriore'
  s.libraries 				= 'xml2'
  s.source 				= { :http => 'file:/Users/danilo/Desktop/SOAPTest/SOAPEngine/SOAPEngine.zip' }
  s.xcconfig				= { 'HEADER_SEARCH_PATHS' => "${PODS_ROOT}/#{s.name}/**" }
  s.vendored_frameworks 	= 'SOAPEngine.xcframework'
  s.preserve_paths 			= 'SOAPEngine.xcframework'
  s.frameworks			= 'Security'
  s.ios.deployment_target   = '7.1'
  s.ios.xcconfig 			= { 'HEADER_SEARCH_PATHS' => '/usr/include/libxml2' }
  s.ios.framework			= 'Accounts'
  s.tvos.deployment_target	= '9.0'
  s.tvos.xcconfig 			= { 'HEADER_SEARCH_PATHS' => '/usr/include/libxml2' }
  s.osx.deployment_target   = '10.9'
  s.osx.framework			= 'AppKit'
  s.osx.framework			= 'Accounts'
end

Project that demonstrates the issue

SOAPTest.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant