1# Copyright (c) Meta Platforms, Inc. and 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
6require "json"
7
8package = JSON.parse(File.read(File.join(__dir__, "..", "package.json")))
9version = package['version']
10
11
12
13folly_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1'
14folly_compiler_flags = folly_flags + ' ' + '-Wno-comma -Wno-shorten-64-to-32'
15folly_version = '2021.07.22.00'
16boost_compiler_flags = '-Wno-documentation'
17
18Pod::Spec.new do |s|
19  s.name                   = "ABI48_0_0React-RCTFabric"
20  s.version                = version
21  s.summary                = "RCTFabric for React Native."
22  s.homepage               = "https://reactnative.dev/"
23  s.license                = package["license"]
24  s.author                 = "Facebook, Inc. and its affiliates"
25  s.platforms              = { :ios => "12.4" }
26  s.source                 = { :path => "." }
27  s.source_files           = "Fabric/**/*.{c,h,m,mm,S,cpp}"
28  s.exclude_files          = "**/tests/*",
29                             "**/android/*",
30  s.compiler_flags         = folly_compiler_flags + ' ' + boost_compiler_flags
31  s.header_dir             = "ABI48_0_0React"
32  s.module_name            = "ABI48_0_0RCTFabric"
33  s.framework              = "JavaScriptCore"
34  s.pod_target_xcconfig    = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/Headers/Private/React-Core\" \"$(PODS_ROOT)/Headers/Public/React-Codegen\" \"${PODS_CONFIGURATION_BUILD_DIR}/React-Codegen/React_Codegen.framework/Headers\"" }
35  s.xcconfig               = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/RCT-Folly\"", "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
36                               "OTHER_CFLAGS" => "$(inherited) -DRN_FABRIC_ENABLED" + " " + folly_flags  }
37
38  s.dependency "ABI48_0_0React-Core", version
39  s.dependency "ABI48_0_0React-Fabric", version
40  s.dependency "ABI48_0_0React-RCTImage", version
41  s.dependency "RCT-Folly/Fabric", folly_version
42
43  s.test_spec 'Tests' do |test_spec|
44    test_spec.source_files = "Tests/**/*.{mm}"
45    test_spec.framework = "XCTest"
46  end
47end
48