This repository was archived by the owner on Jul 1, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change 8
8
* [[ TurboModule] Add the JavaScript specs] ( #js-spec )
9
9
* [[ TurboModule] Set up CodeGen] ( #codegen )
10
10
* [[ TurboModule] Set up build.gradle] ( #android-gradle )
11
+ * [[ TurboModule] Set up podspec file] ( #ios-autolinking )
11
12
12
13
## Steps
13
14
322
323
dependencies {
323
324
implementation 'com.facebook.react:react-native:+'
324
325
}
326
+
327
+ ### <a name="ios-autolinking" />[[TurboModule] Set up ` podspec` file](https://github.com/cipolleschi/RNNewArchitectureLibraries/commit/)
328
+
329
+ 1. Open the ` calculator/ calculator .podspec ` file
330
+ 1. Before the ` Pod:: Spec .new do | s| ` add the following code:
331
+ ` ` ` ruby
332
+ folly_version = ' 2021.07.22.00'
333
+ folly_compiler_flags = ' -DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
334
+ ` ` `
335
+ 1. Before the ` end ` tag, add the following code
336
+ ` ` ` ruby
337
+ # This guard prevent to install the dependencies when we run ` pod install` in the old architecture.
338
+ if ENV [' RCT_NEW_ARCH_ENABLED' ] == ' 1' then
339
+ s .compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
340
+ s .pod_target_xcconfig = {
341
+ " HEADER_SEARCH_PATHS" => " \" $(PODS_ROOT)/boost\" " ,
342
+ " CLANG_CXX_LANGUAGE_STANDARD" => " c++17"
343
+ }
344
+
345
+ s .dependency " React-Codegen"
346
+ s .dependency " RCT-Folly" , folly_version
347
+ s .dependency " RCTRequired"
348
+ s .dependency " RCTTypeSafety"
349
+ s .dependency " ReactCommon/turbomodule/core"
350
+ end
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ require "json"
2
2
3
3
package = JSON . parse ( File . read ( File . join ( __dir__ , "package.json" ) ) )
4
4
5
+ folly_version = '2021.07.22.00'
6
+ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
7
+
5
8
Pod ::Spec . new do |s |
6
9
s . name = "calculator"
7
10
s . version = package [ "version" ]
@@ -16,4 +19,19 @@ Pod::Spec.new do |s|
16
19
s . source_files = "ios/**/*.{h,m,mm,swift}"
17
20
18
21
s . dependency "React-Core"
22
+
23
+ # This guard prevent to install the dependencies when we run `pod install` in the old architecture.
24
+ if ENV [ 'RCT_NEW_ARCH_ENABLED' ] == '1' then
25
+ s . compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
26
+ s . pod_target_xcconfig = {
27
+ "HEADER_SEARCH_PATHS" => "\" $(PODS_ROOT)/boost\" " ,
28
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
29
+ }
30
+
31
+ s . dependency "React-Codegen"
32
+ s . dependency "RCT-Folly" , folly_version
33
+ s . dependency "RCTRequired"
34
+ s . dependency "RCTTypeSafety"
35
+ s . dependency "ReactCommon/turbomodule/core"
36
+ end
19
37
end
You can’t perform that action at this time.
0 commit comments