Work around the broken way CocoaPods/Xcode deals with header maps

Summary:
See https://github.com/facebook/react-native/issues/14326 for the bug
this fixes.  This is a pretty ugly hack to work around what I think is
a CP bug.  Since the C++ dependencies are only needed to build RN
itself, and not applications, don't the conflicting headers as source
files.  Instead, use preserve_paths to get them unpacked into the
source tree under Pods/<Pod>, and arrange for them to get used with
HEADER_SEARCH_PATHS.  This keeps them out of the project, so they
don't get included in the header map, and other (badly structured)
projects don't get confused.

Reviewed By: javache

Differential Revision: D5254716

fbshipit-source-id: cf33dcbcc71b5247843650c33ccf4fb08378e584
This commit is contained in:
Marc Horowitz
2017-06-15 12:47:42 -07:00
committed by Facebook Github Bot
parent c143313a20
commit f3f44eee59
3 changed files with 8 additions and 5 deletions

View File

@@ -107,7 +107,7 @@ Pod::Spec.new do |s|
ss.source_files = "ReactCommon/cxxreact/*.{cpp,h}"
ss.exclude_files = "ReactCommon/cxxreact/{JSCTracing,SampleCxxModule}.*"
ss.private_header_files = "ReactCommon/cxxreact/*.h"
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\"" }
ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Folly\"" }
end
s.subspec "ART" do |ss|