From d40db3a715afaf1cde4a5e231e96e46b2808bbef Mon Sep 17 00:00:00 2001 From: Kevin Cassidy Jr Date: Wed, 17 Jan 2018 19:11:48 -0800 Subject: [PATCH] Use boost-for-react-native CocoaPod Summary: Use the same header-only distribution of Boost that Android and the automatic ios-install-third-party.sh script uses. Greatly speeds up `pod install`, even when the distribution was already cached. The dependency tree looks like this: * React * cxxreact subspec * **Boost** (versioned, 1.63.0) * Folly * **Boost** (any version, will resolve to 1.63.0 from above) Alternative implementation of PR https://github.com/facebook/react-native/pull/16756. Fixes issue #16381. (same as https://github.com/facebook/react-native/pull/16756) * Install react-native via Cocoapods (or move a helloWorld react-native application over to use Cocoapods for dependency management) * Add CxxBridge instead of BatchedBridge to your Podfile * run pod install * run react-native run-ios [Add boost.podspec speed up download time & reduce size of the package](https://github.com/facebook/react-native/pull/16756) [IOS] [BUGFIX] [third-party-podspecs] - optimize CocoaPods installation (Boost distribution) Closes https://github.com/facebook/react-native/pull/17476 Differential Revision: D6746095 Pulled By: hramos fbshipit-source-id: 55b2b5a698691f7fca0bf4c31c4376c2b9eb5379 --- React.podspec | 4 ++-- third-party-podspecs/Folly.podspec | 4 ++-- third-party-podspecs/GLog.podspec | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/React.podspec b/React.podspec index edda6e85fe1..3a2fca54f51 100644 --- a/React.podspec +++ b/React.podspec @@ -139,13 +139,13 @@ Pod::Spec.new do |s| s.subspec "cxxreact" do |ss| ss.dependency "React/jschelpers" ss.dependency "React/jsinspector" - ss.dependency "boost" + ss.dependency "boost-for-react-native", "1.63.0" ss.dependency "Folly", "2016.09.26.00" ss.compiler_flags = folly_compiler_flags ss.source_files = "ReactCommon/cxxreact/*.{cpp,h}" ss.exclude_files = "ReactCommon/cxxreact/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\" \"$(PODS_ROOT)/Folly\"" } + ss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Folly\"" } end s.subspec "ART" do |ss| diff --git a/third-party-podspecs/Folly.podspec b/third-party-podspecs/Folly.podspec index 55d07f3363b..2a855a26ab0 100644 --- a/third-party-podspecs/Folly.podspec +++ b/third-party-podspecs/Folly.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |spec| spec.source = { :git => 'https://github.com/facebook/folly.git', :tag => "v#{spec.version}" } spec.module_name = 'folly' - spec.dependency 'boost' + spec.dependency 'boost-for-react-native' spec.dependency 'DoubleConversion' spec.dependency 'GLog' spec.compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1' @@ -28,7 +28,7 @@ Pod::Spec.new do |spec| spec.libraries = "stdc++" spec.pod_target_xcconfig = { "USE_HEADERMAP" => "NO", "CLANG_CXX_LANGUAGE_STANDARD" => "c++14", - "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\"" } + "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\"" } # Pinning to the same version as React.podspec. spec.platforms = { :ios => "8.0", :tvos => "9.2" } diff --git a/third-party-podspecs/GLog.podspec b/third-party-podspecs/GLog.podspec index 1cea58c1feb..5c8091a47c3 100644 --- a/third-party-podspecs/GLog.podspec +++ b/third-party-podspecs/GLog.podspec @@ -10,6 +10,7 @@ Pod::Spec.new do |spec| spec.source = { :git => 'https://github.com/google/glog.git', :tag => "v#{spec.version}" } spec.module_name = 'glog' + spec.header_dir = 'glog' spec.source_files = 'src/glog/*.h', 'src/demangle.cc', 'src/logging.cc',