-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Hi,
I have a pod A that depends on pod B. Both are C libraries. Pod B (which I don't own) has a directory structure like this:
/include/something/*.h
/src/<*.c and *.h, sometimes in nested dirs>
Includes are expected to be of this form #include <something/header1.h>
, so B's podspec has:
s.public_header_files = 'include/something/*.h'
s.header_mappings_dir = 'include'
Without use_frameworks!
, this works alright, because include/something
gets put into the public headers folder with the appropriate links, and that folder is added to the search path. If the user sets use_frameworks!
in his Podfile, though, the public headers links aren't created, nor added to the search paths, and thus compiling pod A fails.
I inspected the framework created for Pod B, and the headers are all flattened (there's no something
directory inside). Changing #include <something/header1.h>
into #include <B/header1.h>
doesn't work for three reasons:
- It breaks the library if not using frameworks.
- It fails to build anyway because the generated
B-umbrella.h
header in the framework imports UIKit, which can't be built within a C library. - Some of the headers of library B use the form
#include <something/header1.h>
.
Manually copying Pods/Headers/Public
from a pod install
without use_frameworks!
, and adding "$(PODS_ROOT)/Headers/Public/B"
to the search headers path of target A makes everything work again. Because I can't tell people to do the copying manually, I have to resort to the hack of adding "$(PODS_ROOT)/Headers/Private/B"
(private!) to the headers search path in A's podspec, which works, but is all sorts of wrong.
Note: This also happens when both pods are Objective-C, except the generated umbrella header can import UIKit alright in that case.
Thanks a lot for your hard work!