Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ target 'edge' do
unless existing_defs.include?('_LIBCPP_ENABLE_REMOVED_ALLOCATOR_CONST=1')
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = existing_defs + ['_LIBCPP_ENABLE_REMOVED_ALLOCATOR_CONST=1']
end

# Xcode 15+/Apple Clang workaround for fmt consteval incompatibility.
# May not be needed when upgrading to newer versions of React Native.
existing_defs = config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] || ['$(inherited)']
unless existing_defs.include?('FMT_USE_CONSTEVAL=0')
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = existing_defs + ['FMT_USE_CONSTEVAL=0']
end
end
end

Expand Down Expand Up @@ -99,6 +106,31 @@ target 'edge' do
# :ccache_enabled => true
)

# react_native_post_install resets C++ standards from podspecs.
# Force fmt back to C++17 to avoid Apple Clang consteval failures.
# May not be needed when upgrading to newer versions of React Native.
installer.pods_project.targets.each do |target|
next unless target.name == 'fmt'

target.build_configurations.each do |config|
config.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'c++17'
config.build_settings['OTHER_CPLUSPLUSFLAGS'] = ['$(inherited)', '-std=c++17']

xcconfig_ref = config.base_configuration_reference
next if xcconfig_ref.nil?

xcconfig_path = xcconfig_ref.real_path
next unless File.exist?(xcconfig_path)

xcconfig = File.read(xcconfig_path)
updated = xcconfig.gsub(
/^CLANG_CXX_LANGUAGE_STANDARD\s*=\s*.*$/,
'CLANG_CXX_LANGUAGE_STANDARD = c++17'
)
File.write(xcconfig_path, updated) if updated != xcconfig
end
end

# Remove the -lsqlite3 linker flag.
# We already include our own sqlite3 implementation via a pod,
# so we don't want the system-provided one as well.
Expand Down
2 changes: 1 addition & 1 deletion ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3500,6 +3500,6 @@ SPEC CHECKSUMS:
ZIPFoundation: dfd3d681c4053ff7e2f7350bc4e53b5dba3f5351
ZXingObjC: 8898711ab495761b2dbbdec76d90164a6d7e14c5

PODFILE CHECKSUM: ffc45b7c82f76539837854e7add5bc6ad74ef0b6
PODFILE CHECKSUM: 3c9f8ab9de75f819ada260a3d6d3f372a510d556

COCOAPODS: 1.16.2
Loading