Skip to content

Commit

Permalink
fix: Fix "Folly" include (mrousavy#273)
Browse files Browse the repository at this point in the history
* fix: Fix "folly" header not found by including the header search path

* cleanup
  • Loading branch information
mrousavy authored Oct 13, 2021
1 parent 1f4d188 commit 0058b52
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions VisionCamera.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@ require "json"

package = JSON.parse(File.read(File.join(__dir__, "package.json")))

reactVersion = '0.0.0'
begin
reactVersion = JSON.parse(File.read(File.join(__dir__, "..", "react-native", "package.json")))["version"]
rescue
reactVersion = '0.66.0'
end
rnVersion = reactVersion.split('.')[1]

folly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DRNVERSION=' + rnVersion
folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32'
folly_version = '2021.04.26.00'
boost_compiler_flags = '-Wno-documentation'

Pod::Spec.new do |s|
s.name = "VisionCamera"
s.version = package["version"]
Expand All @@ -14,10 +27,16 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/mrousavy/react-native-vision-camera.git", :tag => "#{s.version}" }

s.pod_target_xcconfig = {
"DEFINES_MODULE" => "YES",
"USE_HEADERMAP" => "YES",
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/Headers/Private/React-Core\" \"$(PODS_ROOT)/Headers/Public/React-hermes\" \"$(PODS_ROOT)/Headers/Public/hermes-engine\""
"HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_TARGET_SRCROOT)\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\" "
}
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
s.xcconfig = {
"CLANG_CXX_LANGUAGE_STANDARD" => "c++14",
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/RCT-Folly\" \"${PODS_ROOT}/Headers/Public/React-hermes\" \"${PODS_ROOT}/Headers/Public/hermes-engine\"",
"OTHER_CFLAGS" => "$(inherited)" + " " + folly_flags
}

s.requires_arc = true

# All source files that should be publicly visible
Expand Down

0 comments on commit 0058b52

Please sign in to comment.