From 20f0882aa9b7fa35476f941a7e5e4c4b75451f92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Fazekas?= Date: Wed, 1 Jul 2026 12:11:44 +0200 Subject: [PATCH] fix(ios): build fmt pod as C++17 to fix Xcode 26.4+ consteval error Xcode 26.4+ (Apple clang 21) rejects fmt's compile-time FMT_STRING (consteval) as non-constant. Compiling only the fmt pod as C++17 makes fmt's base.h disable consteval (FMT_CPLUSPLUS < 201709 -> FMT_USE_CONSTEVAL 0). A -DFMT_USE_CONSTEVAL=0 define does NOT work: base.h re-#defines the macro unconditionally and overrides it. Verified building on Xcode 26.6. Fixed upstream in RN 0.83+. --- example/ios/Podfile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/example/ios/Podfile b/example/ios/Podfile index c04206ab..fd1bccfd 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -33,5 +33,20 @@ target 'RiveExample' do :mac_catalyst_enabled => false, # :ccache_enabled => true ) + + # fmt `consteval` build error on Xcode 26.4+ (Apple clang 21): fmt's compile-time + # FMT_STRING (basic_format_string's consteval ctor) is rejected as a non-constant + # expression. Compile only the `fmt` pod as C++17 so fmt's own base.h disables consteval: + # with FMT_CPLUSPLUS < 201709 it hits `#define FMT_USE_CONSTEVAL 0` before the + # `__cpp_consteval` branch. NOTE: a plain `-DFMT_USE_CONSTEVAL=0` define does NOT work — + # base.h re-#defines FMT_USE_CONSTEVAL unconditionally (it is not #ifndef-guarded), so it + # overrides any command-line define. Verified on Xcode 26.6. Real fix is upstream in + # React Native 0.83+ (fmtlib/fmt#4740, facebook/react-native#55601); remove once we bump. + installer.pods_project.targets.each do |target| + next unless target.name == 'fmt' + target.build_configurations.each do |bc| + bc.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'c++17' + end + end end end