Skip to content

Commit 593bcbf

Browse files
authored
Merge pull request #135 from fobos531/patch-1
do not install folly manually if prebuilt RN deps are used
2 parents 3886e6d + a823362 commit 593bcbf

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

react-native-ios-context-menu.podspec

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ use_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1'
2828
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
2929

3030
folly_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

3336
linkage = ENV['USE_FRAMEWORKS']
3437
reactNativeTargetVersionOverride = ENV['REACT_NATIVE_TARGET_VERSION']
@@ -46,7 +49,9 @@ if reactNativeTargetVersionOverride
4649
end
4750

4851
fabric_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

5156
if 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

Comments
 (0)