Skip to content

Commit 614b3ba

Browse files
committed
Fix ios build error when podfile generate_multiple_pod_projects=true and fabric is on.
1 parent a0511a1 commit 614b3ba

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

React/React-RCTFabric.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Pod::Spec.new do |s|
3636
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
3737
s.header_dir = "React"
3838
s.framework = "JavaScriptCore"
39-
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/Headers/Private/React-Core\" \"$(PODS_ROOT)/Headers/Public/React-Codegen\"" }
39+
s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/DoubleConversion\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/Headers/Private/React-Core\" \"$(PODS_ROOT)/Headers/Public/React-Codegen\" \"$(PODS_ROOT)/Headers/Private/Yoga/yoga\"" }
4040
s.xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/RCT-Folly\"", "CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
4141
"OTHER_CFLAGS" => "$(inherited) -DRN_FABRIC_ENABLED" + " " + folly_flags }
4242

ReactCommon/React-Fabric.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ Pod::Spec.new do |s|
218218
sss.source_files = "react/renderer/components/view/**/*.{m,mm,cpp,h}"
219219
sss.exclude_files = "react/renderer/components/view/tests"
220220
sss.header_dir = "react/renderer/components/view"
221-
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
221+
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/Headers/Private/Yoga/yoga\"" }
222222
end
223223
end
224224

scripts/react_native_pods.rb

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,14 @@ def modify_flags_for_new_architecture(installer, cpp_flags)
264264
config_file.save_as(xcconfig_path)
265265
end
266266
end
267-
# Add RCT_NEW_ARCH_ENABLED to Pods project xcconfig
268-
installer.pods_project.targets.each do |target|
269-
# if target.name == 'React-Core'
270-
if target.name == 'React-Core'
271-
puts "#{target.name}"
272-
target.build_configurations.each do |config|
273-
config.build_settings['OTHER_CPLUSPLUSFLAGS'] = cpp_flags
274-
end
267+
268+
# Add RCT_NEW_ARCH_ENABLED to generated pod target projects
269+
installer.target_installation_results.pod_target_installation_results
270+
.each do |pod_name, target_installation_result|
271+
if pod_name == 'React-Core'
272+
target_installation_result.native_target.build_configurations.each do |config|
273+
config.build_settings['OTHER_CPLUSPLUSFLAGS'] = cpp_flags
274+
end
275275
end
276276
end
277277
end
@@ -369,6 +369,7 @@ def get_react_codegen_spec(options={})
369369
"\"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\"",
370370
"\"$(PODS_ROOT)/Headers/Private/React-Fabric\"",
371371
"\"$(PODS_ROOT)/Headers/Private/React-RCTFabric\"",
372+
"\"$(PODS_ROOT)/Headers/Private/Yoga/yoga\"",
372373
].join(' ')
373374
},
374375
'dependencies': {

0 commit comments

Comments
 (0)