Making a pod for iOS development

Hello,

I’m trying to make an iOS pod out of the Csound iOS SDK.
Unfortunately it doesn’t work.
Here is my podspec file which was created with : “pod lib create Csound”.

Pod::Spec.new do |s|
  s.name             = 'Csound'
  s.version          = '0.1.0'
  s.summary          = 'A short description of Csound.'

  s.description      = <<-DESC
TODO: Add long description of the pod here.
                       DESC

  s.homepage         = 'https://github.com/moplat/Csound'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'moplat' => 'morgane.plat@beathealth.eu' }
  s.source           = { :git => 'https://github.com/moplat/Csound.git', :tag => s.version.to_s }

  s.ios.deployment_target = '12.0'
  
  s.subspec 'Libs' do |ss|
    ss.dependency 'Csound/StaticLibs'
    ss.public_header_files = ['Csound/Classes/**/*.h', 'Csound/Headers/*']
    ss.source_files = ['Csound/Classes/**/*', 'Csound/Headers/*']
    ss.frameworks = ['Accelerate']
  end
  
  s.subspec 'StaticLibs' do |ss|
    ss.vendored_libraries = ['Csound/Libs/libcsound.a', 'Csound/Libs/libsndfile.a']
    ss.libraries = ['csound', 'sndfile']
    ss.frameworks = ['Accelerate']
  end
end

In this version, “StaticLibs” is created with the libcsound.a and libsndfile.a.
“Libs” has a dependency on the “StaticLibs” and includes source files and headers, together with the Accelerate framework (that I saw was added into the iOS Example project provided with the iOS SDK).

I tried other configurations, but I couldn’t make it work.
Has anyone ever tried and succeeded to make a pod ?

Cheers,
Morgane

I’m afraid not. I’ve never found that I needed a Pod as I can just bring the Csound iOS libraries directly into my projects. What does a pod offer that an xcframework doesn’t?

A pod could then be added into a Kotlin Multiplatform project, this could even lead to a new Csound KMP library since I already have the Android SDK working.

Sorry I can’t be of more help. Do you get some build errors?

I finally made it work by keeping only the .h files in Headers that were requested when building with xcode. For information here are the files I kept :

  • cfgvar.h
  • csound.h
  • float-version.h
  • msg-attr.h
  • sysdep.h
  • text.h
  • version.h

It now compiles and the SimpleTest1ViewController works fine !
Thanks for trying to help, I’ll open another topic with a different question :slight_smile: