@@ -2,6 +2,8 @@ require "json"
22
33package  =  JSON . parse ( File . read ( File . join ( __dir__ ,  "package.json" ) ) ) 
44
5+ # This Podspec is used for local development 
6+ 
57Pod ::Spec . new  do  |s |
68  s . name          =  "react-native-babylon" 
79  s . version       =  package [ "version" ] 
@@ -17,47 +19,73 @@ Pod::Spec.new do |s|
1719  s . requires_arc  =  true 
1820  s . xcconfig      =  {  'USER_HEADER_SEARCH_PATHS'  =>  '$(inherited) ${PODS_TARGET_SRCROOT}/shared ${PODS_TARGET_SRCROOT}/../react-native/shared'  } 
1921
20-   s . libraries  =  'astc-encoder' , 
21-                 'etc1' , 
22-                 'etc2' , 
23-                 'nvtt' , 
24-                 'squish' , 
25-                 'pvrtc' , 
26-                 'iqa' , 
27-                 'edtaa3' , 
28-                 'tinyexr' , 
29-                 'BabylonNative' , 
30-                 'bgfx' , 
31-                 'bimg' , 
32-                 'bx' , 
33-                 'Canvas' , 
34-                 'GenericCodeGen' , 
35-                 'glslang' , 
36-                 'glslang-default-resource-limits' , 
37-                 'Graphics' , 
38-                 'jsRuntime' , 
39-                 'OGLCompiler' , 
40-                 'OSDependent' , 
41-                 'MachineIndependent' , 
42-                 'napi' , 
43-                 'NativeCamera' , 
44-                 'NativeCapture' , 
45-                 'NativeEngine' , 
46-                 'NativeInput' , 
47-                 'NativeOptimizations' , 
48-                 'NativeTracing' , 
49-                 'NativeXR' , 
50-                 'SPIRV' , 
51-                 'spirv-cross-core' , 
52-                 'spirv-cross-msl' , 
53-                 'tinyexr' , 
54-                 'UrlLib' , 
55-                 'Window' , 
56-                 'XMLHttpRequest' , 
57-                 'xr' 
22+   if  ENV [ 'BUILD_BABYLON_FROM_SOURCE' ]  == 'true'  then 
23+     s . libraries  =  'astc-encoder' , 
24+       'etc1' , 
25+       'etc2' , 
26+       'nvtt' , 
27+       'squish' , 
28+       'pvrtc' , 
29+       'iqa' , 
30+       'edtaa3' , 
31+       'tinyexr' , 
32+       'BabylonNative' , 
33+       'bgfx' , 
34+       'bimg' , 
35+       'bx' , 
36+       'Canvas' , 
37+       'GenericCodeGen' , 
38+       'glslang' , 
39+       'glslang-default-resource-limits' , 
40+       'Graphics' , 
41+       'jsRuntime' , 
42+       'OGLCompiler' , 
43+       'OSDependent' , 
44+       'MachineIndependent' , 
45+       'napi' , 
46+       'NativeCamera' , 
47+       'NativeCapture' , 
48+       'NativeEngine' , 
49+       'NativeInput' , 
50+       'NativeOptimizations' , 
51+       'NativeTracing' , 
52+       'NativeXR' , 
53+       'SPIRV' , 
54+       'spirv-cross-core' , 
55+       'spirv-cross-msl' , 
56+       'tinyexr' , 
57+       'UrlLib' , 
58+       'Window' , 
59+       'XMLHttpRequest' , 
60+       'xr' 
61+   else 
62+     s . vendored_frameworks  =  "ios/libs/*.xcframework" 
63+   end 
5864
5965  s . frameworks  =  "MetalKit" ,  "ARKit" 
6066
61-   s . dependency  "React" 
67+   # install_modules_dependencies has been defined in RN 0.70 
68+   # This check ensure that the library can work on older versions of RN 
69+   if  defined? ( install_modules_dependencies ) 
70+     install_modules_dependencies ( s ) 
71+   else 
72+     s . dependency  "React-Core" 
73+ 
74+     # Don't install the dependencies when we run `pod install` in the old architecture. 
75+     if  new_arch_enabled  then 
76+       s . compiler_flags  =  folly_compiler_flags  + " -DRCT_NEW_ARCH_ENABLED=1" 
77+       s . pod_target_xcconfig     =  { 
78+         "HEADER_SEARCH_PATHS"  =>  "\" $(PODS_ROOT)/boost\" " , 
79+         "OTHER_CPLUSPLUSFLAGS"  =>  "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1" , 
80+         "CLANG_CXX_LANGUAGE_STANDARD"  =>  "c++17" 
81+       } 
82+       s . dependency  "React-Codegen" 
83+       s . dependency  "RCT-Folly" 
84+       s . dependency  "RCTRequired" 
85+       s . dependency  "RCTTypeSafety" 
86+       s . dependency  "ReactCommon/turbomodule/core" 
87+       s . dependency  "React-RCTFabric" 
88+     end 
89+   end 
6290end 
6391
0 commit comments