Skip to content

Commit

Permalink
Fix Xcode 15 build issue by taking RN Ruby script patch
Browse files Browse the repository at this point in the history
A cherry-pick of facebook/react-native@37e8df1cd.

We applied this patch in zulip-mobile@3e8440542 using patch-package
without committing here in Zulip's react-native fork. Carry it over
here, so that the changes described in patch-package's patch file
correspond to the commits here.
  • Loading branch information
chrisbobbe committed Sep 21, 2024
1 parent b97a328 commit d94fa14
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions scripts/react_native_pods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ def react_native_post_install(installer)
cpp_flags = NEW_ARCH_OTHER_CPLUSPLUSFLAGS
end
modify_flags_for_new_architecture(installer, cpp_flags)
apply_xcode_15_patch(installer)

end

Expand Down Expand Up @@ -661,3 +662,16 @@ def __apply_Xcode_12_5_M1_post_install_workaround(installer)
time_header = "#{Pod::Config.instance.installation_root.to_s}/Pods/RCT-Folly/folly/portability/Time.h"
`sed -i -e $'s/ && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0)//' #{time_header}`
end

# Fix to build react native on Xcode 15 beta 1
def apply_xcode_15_patch(installer)
installer.target_installation_results.pod_target_installation_results
.each do |pod_name, target_installation_result|
target_installation_result.native_target.build_configurations.each do |config|
# unary_function and binary_function are no longer provided in C++17 and newer standard modes as part of Xcode 15. They can be re-enabled with setting _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
# Ref: https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Deprecations
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= '$(inherited) '
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << '"_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION" '
end
end
end

0 comments on commit d94fa14

Please sign in to comment.