Skip to content

Commit

Permalink
Fix ios build error when podfile generate_multiple_pod_projects=true …
Browse files Browse the repository at this point in the history
…and fabric is on.
  • Loading branch information
Kudo committed Mar 4, 2022
1 parent 4eef075 commit eb34db0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion React/React-RCTFabric.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Pod::Spec.new do |s|
s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags
s.header_dir = "React"
s.framework = "JavaScriptCore"
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\"" }
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\"" }
s.xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\" \"$(PODS_ROOT)/glog\" \"$(PODS_ROOT)/RCT-Folly\"",
"OTHER_CFLAGS" => "$(inherited) -DRN_FABRIC_ENABLED" + " " + folly_flags }

Expand Down
2 changes: 1 addition & 1 deletion ReactCommon/React-Fabric.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ Pod::Spec.new do |s|
sss.source_files = "react/renderer/components/view/**/*.{m,mm,cpp,h}"
sss.exclude_files = "react/renderer/components/view/tests"
sss.header_dir = "react/renderer/components/view"
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\"" }
sss.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_TARGET_SRCROOT)/ReactCommon\" \"$(PODS_ROOT)/RCT-Folly\" \"$(PODS_ROOT)/Headers/Private/Yoga/yoga\"" }
end
end

Expand Down
20 changes: 10 additions & 10 deletions scripts/react_native_pods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,16 +264,15 @@ def modify_flags_for_new_architecture(installer, cpp_flags)
config_file.save_as(xcconfig_path)
end
end
# Add RCT_NEW_ARCH_ENABLED to Pods project xcconfig
installer.pods_project.targets.each do |target|
# if target.name == 'React-Core'
if target.name == 'React-Core'
puts "#{target.name}"
target.build_configurations.each do |config|
config.build_settings['OTHER_CPLUSPLUSFLAGS'] = cpp_flags
end
end
end

installer.target_installation_results.pod_target_installation_results
.each do |pod_name, target_installation_result|
if pod_name == 'React-Core'
target_installation_result.native_target.build_configurations.each do |config|
config.build_settings['OTHER_CPLUSPLUSFLAGS'] = cpp_flags
end
end
end
end

def build_codegen!(react_native_path)
Expand Down Expand Up @@ -369,6 +368,7 @@ def get_react_codegen_spec(options={})
"\"${PODS_ROOT}/Headers/Public/React-Codegen/react/renderer/components\"",
"\"$(PODS_ROOT)/Headers/Private/React-Fabric\"",
"\"$(PODS_ROOT)/Headers/Private/React-RCTFabric\"",
"\"$(PODS_ROOT)/Headers/Private/Yoga/yoga\"",
].join(' ')
},
'dependencies': {
Expand Down

0 comments on commit eb34db0

Please sign in to comment.