Skip to content


Subversion checkout URL

You can clone with
Download ZIP


ZBarSDK podspec headers and warnings #721

Zyphrax opened this Issue · 12 comments

2 participants


In my project I'm using the ZBarSDK pod. It works fine but it is raising all kinds of warnings in the Pods project which is annoying.

You can find the podspec here:

I was able to fix the basic warnings caused by the C code by adding:
s.compiler_flags = '-w'

Now I have two issues left:

  • There are two files called (different) debug.h and they are both copied as public headers, which results in a "Warning: Multiple build commands for output file" warning
  • The Pods/Headers folder is messy, there isn't a nice folder called ZBarSDK, but there are three folders being generated: zbar, include and iphone.

Do you guys have any ideas how I could resolve these issues?
I've tried some stuff with s.public_header_files, but that doesn't work.

  • Removing s.header_mappings_dir = 'zbar' seems to reduce the folder clutter.
  • Still not able to remove the C headers from the Copy headers - public list. The option s.public_header_files does copy the right files to the Headers folder, but the project still adds all of them to the Copy headers - public list

I added this post_install script which removes the PBXBuildFile reference for all ZBarSDK/zbar header files which removes it from the copy headers list completely. It could be modified to move them into the Private list, but seeing as the header search paths are setup correctly it shouldn't be necessary. There are probably better ways to do this, but this my first time writing ruby.

def s.post_install(target_installer)
  project = target_installer.project
  project.objects_by_uuid.each do |key, obj|
    if obj.isa.to_s == "PBXBuildFile"
      file_ref = obj.file_ref
      if file_ref.isa.to_s == "PBXFileReference"
        path = file_ref.pathname

        if (path.extname.to_s == ".h" && path.dirname.to_s.include?("ZBarSDK/zbar"))

I added the compiler_flag and public_header_files options. It seems to be working quite well now.


There is one last issue with the podspec.
The line s.header_mappings_dir = 'zbar' is causing a bit of a mess in the Pods/Headers folder. Instead of a nice ZBarSDK folder, there are iphone and include folders.

Simply removing the line from the podspec seems to fix that.
Could you update that? Or is there a real reason for it in the podspec?

Thanks for your help!


Yeah, I don't know what the option does either, but it somehow removes the ZBarSDK folder level.
I don't know why anyone would ever want that, it just results in a mess and pods possibly mixing code.

More info here:


I have removed the line in my local podspec and haven't had any issues with the pod.
Could you update the public one in the CocoaPods spec library?



Updated the podspec. I believe this option is used when the header folder structure is important (i.e if you have lines like this in your code '#import "include/header.h"'. This isn't the case for ZBar.


Awesome, thanks

@Zyphrax Zyphrax closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.