@@ -2,6 +2,8 @@ require 'json'
2
2
3
3
package = JSON . parse ( File . read ( File . join ( __dir__ , 'package.json' ) ) )
4
4
5
+ fabric_enabled = ENV [ 'RCT_NEW_ARCH_ENABLED' ] == '1'
6
+
5
7
Pod ::Spec . new do |s |
6
8
s . name = "RNCAsyncStorage"
7
9
s . version = package [ 'version' ]
@@ -10,10 +12,30 @@ Pod::Spec.new do |s|
10
12
11
13
s . authors = package [ 'author' ]
12
14
s . homepage = package [ 'homepage' ]
13
- s . platforms = { :ios => "9.0" , :tvos => "9.2" , :osx => "10.14" }
14
15
15
16
s . source = { :git => "https://github.com/react-native-async-storage/async-storage.git" , :tag => "v#{ s . version } " }
16
- s . source_files = "ios/**/*.{h,m}"
17
+ s . source_files = "ios/**/*.{h,m,mm}"
18
+
19
+ if fabric_enabled
20
+ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
21
+
22
+ s . pod_target_xcconfig = {
23
+ 'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native" "$(PODS_ROOT)/RCT-Folly"' ,
24
+ 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17' ,
25
+ }
26
+ s . platforms = { ios : '11.0' , tvos : '11.0' , :osx => "10.14" }
27
+ s . compiler_flags = folly_compiler_flags + ' -DRCT_NEW_ARCH_ENABLED'
28
+
29
+ s . dependency "React"
30
+ s . dependency "React-RCTFabric" # This is for fabric component
31
+ s . dependency "React-Codegen"
32
+ s . dependency "RCT-Folly"
33
+ s . dependency "RCTRequired"
34
+ s . dependency "RCTTypeSafety"
35
+ s . dependency "ReactCommon/turbomodule/core"
36
+ else
37
+ s . platforms = { :ios => "9.0" , :tvos => "9.2" , :osx => "10.14" }
17
38
18
- s . dependency 'React-Core'
39
+ s . dependency "React-Core"
40
+ end
19
41
end
0 commit comments