@@ -28,7 +28,10 @@ use_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1'
2828fabric_enabled = ENV [ 'RCT_NEW_ARCH_ENABLED' ] == '1'
2929
3030folly_version = '2022.05.16.00'
31- folly_compiler_flags = get_folly_config ( ) [ :compiler_flags ]
31+ folly_compiler_flags = ( get_folly_config ( ) [ :compiler_flags ] || '' ) . strip
32+ base_flags = "-DREACT_NATIVE_TARGET_VERSION=#{ reactNativeTargetVersion } "
33+
34+ compiler_flags = base_flags . dup
3235
3336linkage = ENV [ 'USE_FRAMEWORKS' ]
3437reactNativeTargetVersionOverride = ENV [ 'REACT_NATIVE_TARGET_VERSION' ]
@@ -46,7 +49,9 @@ if reactNativeTargetVersionOverride
4649end
4750
4851fabric_compiler_flags = '-DRN_FABRIC_ENABLED -DRCT_NEW_ARCH_ENABLED'
49- compiler_flags = folly_compiler_flags + ' ' + "-DREACT_NATIVE_TARGET_VERSION=#{ reactNativeTargetVersion } "
52+ if ENV [ 'RCT_USE_RN_DEP' ] != '1'
53+ compiler_flags = [ folly_compiler_flags , base_flags ] . reject ( &:empty? ) . join ( ' ' )
54+ end
5055
5156if use_hermes
5257 compiler_flags << ' -DUSE_HERMES'
@@ -156,7 +161,9 @@ Pod::Spec.new do |s|
156161
157162 if fabric_enabled
158163 s . dependency 'React-RCTFabric'
159- s . dependency 'RCT-Folly' , folly_version
164+ if ENV [ 'RCT_USE_RN_DEP' ] != '1'
165+ s . dependency 'RCT-Folly' , folly_version
166+ end
160167 end
161168
162169 s . dependency 'react-native-ios-utilities'
@@ -179,4 +186,4 @@ Pod::Spec.new do |s|
179186 s . public_header_files = 'ios/**/*.h'
180187 s . private_header_files = [ 'ios/**/*+Private.h' , 'ios/**/Swift.h' ]
181188
182- end
189+ end
0 commit comments