1 | require 'json'
|
2 |
|
3 | new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
|
4 | ios_platform = new_arch_enabled ? '11.0' : '9.0'
|
5 |
|
6 | package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
7 |
|
8 | Pod::Spec.new do |s|
|
9 | s.name = package['name']
|
10 | s.version = package['version']
|
11 | s.summary = package['description']
|
12 | s.license = package['license']
|
13 |
|
14 | s.authors = package['author']
|
15 | s.homepage = package['homepage']
|
16 | s.platforms = { :ios => ios_platform, :osx => "10.13", :visionos => "1.0" }
|
17 |
|
18 | s.source = { :git => "https://github.com/react-native-webview/react-native-webview.git", :tag => "v#{s.version}" }
|
19 |
|
20 | s.source_files = "apple/**/*.{h,m,mm,swift}"
|
21 |
|
22 | if defined?(install_modules_dependencies()) != nil
|
23 | install_modules_dependencies(s);
|
24 | else
|
25 | if new_arch_enabled
|
26 | folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
|
27 |
|
28 | s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
29 |
|
30 | s.pod_target_xcconfig = {
|
31 | "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
32 | "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
33 | "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
34 | }
|
35 |
|
36 | s.dependency "React-RCTFabric"
|
37 | s.dependency "React-Codegen"
|
38 | s.dependency "RCT-Folly"
|
39 | s.dependency "RCTRequired"
|
40 | s.dependency "RCTTypeSafety"
|
41 | s.dependency "ReactCommon/turbomodule/core"
|
42 | else
|
43 | s.dependency "React-Core"
|
44 | end
|
45 | end
|
46 | end
|