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_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
14folly_version = '2021.07.22.00'
15
16header_search_paths = [
17    "\"$(PODS_ROOT)/RCT-Folly\"",
18    "\"$(PODS_TARGET_SRCROOT)\"",
19    "\"$(PODS_TARGET_SRCROOT)/ReactCommon\"",
20]
21
22if ENV["USE_FRAMEWORKS"]
23  header_search_paths << "\"${PODS_CONFIGURATION_BUILD_DIR}/React-debug/React_debug.framework/Headers\""
24end
25
26Pod::Spec.new do |s|
27  s.name                   = "ABI49_0_0React-utils"
28  s.version                = version
29  s.summary                = "-"  # TODO
30  s.homepage               = "https://reactnative.dev/"
31  s.license                = package["license"]
32  s.author                 = "Meta Platforms, Inc. and its affiliates"
33  s.platforms              = { :ios => min_ios_version_supported }
34  s.source                 = { :path => "." }
35  s.source_files           = "**/*.{cpp,h,mm}"
36  s.compiler_flags         = folly_compiler_flags
37  s.header_dir             = "ABI49_0_0react/utils"
38  s.exclude_files          = "tests"
39  s.pod_target_xcconfig    = {
40    "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
41    "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')}
42
43  if ENV['USE_FRAMEWORKS']
44    s.module_name            = "ABI49_0_0React_utils"
45    s.header_mappings_dir  = File.absolute_path("../..")
46  end
47
48  s.dependency "RCT-Folly", folly_version
49  s.dependency "ABI49_0_0React-debug"
50  s.dependency "glog"
51end
52