ReactCommon.podspec 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
  16. folly_version = '2020.01.13.00'
  17. boost_compiler_flags = '-Wno-documentation'
  18. Pod::Spec.new do |s|
  19. s.name = "ReactCommon"
  20. s.module_name = "ReactCommon"
  21. s.version = version
  22. s.summary = "-" # TODO
  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.header_dir = "ReactCommon" # Use global header_dir for all subspecs for use_frameworks! compatibility
  29. s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
  30. s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Folly\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/Headers/Private/React-Core\"",
  31. "USE_HEADERMAP" => "YES",
  32. "CLANG_CXX_LANGUAGE_STANDARD" => "c++14" }
  33. s.subspec "turbomodule" do |ss|
  34. ss.dependency "React-callinvoker", version
  35. ss.dependency "React-Core", version
  36. ss.dependency "React-cxxreact", version
  37. ss.dependency "React-jsi", version
  38. ss.dependency "Folly", folly_version
  39. ss.dependency "DoubleConversion"
  40. ss.dependency "glog"
  41. ss.subspec "core" do |sss|
  42. sss.source_files = "turbomodule/core/*.{cpp,h}",
  43. "turbomodule/core/platform/ios/*.{mm,cpp,h}"
  44. end
  45. ss.subspec "samples" do |sss|
  46. sss.source_files = "turbomodule/samples/*.{cpp,h}",
  47. "turbomodule/samples/platform/ios/*.{mm,cpp,h}"
  48. sss.dependency "ReactCommon/turbomodule/core", version
  49. end
  50. end
  51. end