React-RCTFabric.podspec 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # Copyright (c) Facebook, Inc. and its affiliates.
  2. #
  3. # This source code is licensed under the MIT license found in the
  4. # LICENSE file in the root directory of this source tree.
  5. require "json"
  6. package = JSON.parse(File.read(File.join(__dir__, "..", "package.json")))
  7. version = package['version']
  8. source = { :git => 'https://github.com/facebook/react-native.git' }
  9. if version == '1000.0.0'
  10. # This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
  11. source[:commit] = `git rev-parse HEAD`.strip
  12. else
  13. source[:tag] = "v#{version}"
  14. end
  15. folly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1'
  16. folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32'
  17. folly_version = '2020.01.13.00'
  18. boost_compiler_flags = '-Wno-documentation'
  19. Pod::Spec.new do |s|
  20. s.name = "React-RCTFabric"
  21. s.version = version
  22. s.summary = "RCTFabric for React Native."
  23. s.homepage = "https://reactnative.dev/"
  24. s.license = package["license"]
  25. s.author = "Facebook, Inc. and its affiliates"
  26. s.platforms = { :ios => "10.0", :tvos => "10.0" }
  27. s.source = source
  28. s.source_files = "Fabric/**/*.{c,h,m,mm,S,cpp}"
  29. s.exclude_files = "**/tests/*",
  30. "**/android/*",
  31. s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
  32. s.header_dir = "React"
  33. s.framework = "JavaScriptCore"
  34. s.library = "stdc++"
  35. s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Folly\" \"$(PODS_ROOT)/Headers/Private/React-Core\"" }
  36. s.xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/Folly\"",
  37. "OTHER_CFLAGS" => "$(inherited) -DRN_FABRIC_ENABLED" + " " + folly_flags }
  38. s.dependency "React-Core", version
  39. s.dependency "React-Fabric", version
  40. s.dependency "React-RCTImage", version
  41. s.dependency "Folly/Fabric", folly_version
  42. end