Set requires_arc on a per file basis #464

Closed
indragiek opened this Issue Aug 19, 2012 · 2 comments

Comments

Projects
None yet
3 participants

Some libraries have certain files that need to be compiled without ARC. Right now, you can only set requires_arc on every file included in the podspec. I tried using a subspec to separate out the files that have ARC turned off, but I got an error saying that requires_arc can't be set on a subspec.

Owner

fabiopelosin commented Aug 20, 2012

The support should be available in the next version.

inismor commented Feb 22, 2013

I'm having the same issue trying to create a podspec for MESegmentedControl. There are only two source files; one needs to be compiled with ARC and the other without. I too tried to resolve the difference with subspecs:

Pod::Spec.new do |s|
  s.name         = "MESegmentedControl"
  s.version      = "0.0.1"
  s.summary      = "Podspec for MESegmentedControl"
  s.author       = { "Dave Thompson" => "dave_thompson@mba.berkeley.edu" }
  s.license      = {
    :type =>    'Modified BSD',
    :text =>    <<-LICENSE
                Copyright (c) 2012 David Thompson. All rights reserved.
                MESegmentedControl is distributed under the Modified BSD License.
    LICENSE
    }
  s.platform     = :ios
  s.source       = { :git => 'git://github.com/dave-thompson/MESegmentedControl.git' }

  s.subspec 'Badges' do |badges|
    badges.source_files = 'MESegmentedControl/CustomBadges.{h,m}'
    badges.requires_arc = false
  end

  s.subspec 'Control' do |control|
    control.source_files    = 'MESegmentedControl/MESegmentedControl.{h,m}'
#    control.dependency     = 'MESegmentedControl/Badges'
    control.requires_arc    = true
  end
end

but no love. So yes, the subspec allows .requires_arc but... If I use the podspec as is, the "Badges" files aren't copied down. If I uncomment the dependency line, I get an "undefined method `dependency=" error. Am I not getting the syntax right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment