Skip to content

Commit 37e8df1

Browse files
author
Riccardo Cipolleschi
committed
[LOCAL] Make 0.69 compatible with Xcode 15 (thanks to @AlexanderEggers for the commit in main)
1 parent 4f52bbc commit 37e8df1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

scripts/react_native_pods.rb

+14
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ def react_native_post_install(installer, react_native_path = "../node_modules/re
317317
cpp_flags = NEW_ARCH_OTHER_CPLUSPLUSFLAGS
318318
end
319319
modify_flags_for_new_architecture(installer, cpp_flags)
320+
apply_xcode_15_patch(installer)
320321

321322
set_node_modules_user_settings(installer, react_native_path)
322323
end
@@ -728,6 +729,19 @@ def __apply_Xcode_12_5_M1_post_install_workaround(installer)
728729
`sed -i -e $'s/ && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0)//' #{time_header}`
729730
end
730731

732+
# Fix to build react native on Xcode 15 beta 1
733+
def apply_xcode_15_patch(installer)
734+
installer.target_installation_results.pod_target_installation_results
735+
.each do |pod_name, target_installation_result|
736+
target_installation_result.native_target.build_configurations.each do |config|
737+
# 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
738+
# Ref: https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes#Deprecations
739+
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= '$(inherited) '
740+
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] << '"_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION" '
741+
end
742+
end
743+
end
744+
731745
# Monkeypatch of `Pod::Lockfile` to ensure automatic update of dependencies integrated with a local podspec when their version changed.
732746
# This is necessary because local podspec dependencies must be otherwise manually updated.
733747
module LocalPodspecPatch

0 commit comments

Comments
 (0)