From d7a8aae9acc441d9b6c52484e35ba158e90b4b60 Mon Sep 17 00:00:00 2001 From: Thibault Malbranche Date: Tue, 8 Oct 2024 08:09:25 -0700 Subject: [PATCH] fix: override podspecs dependencies c++ version (#46888) Summary: Some dependencies would override C++ version like [this](https://github.com/mrousavy/react-native-vision-camera/blob/83abb0832a22b6b080f8412ed17b0992532b0eb2/VisionCamera.podspec#L36). We force it back to be the current version set by react-native so that we are sure projects are using the correct version ## Changelog: [IOS] [FIXED] - Enforce we use the correct C++ version for all, even if dependency tries to set it Pull Request resolved: https://github.com/facebook/react-native/pull/46888 Test Plan: This can be test via https://github.com/Titozzz/cpp17bug Reviewed By: blakef Differential Revision: D64042099 Pulled By: cipolleschi fbshipit-source-id: c36dda0a718e52e19d53c3e9d895315141cb040c --- .../react-native/scripts/cocoapods/new_architecture.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/react-native/scripts/cocoapods/new_architecture.rb b/packages/react-native/scripts/cocoapods/new_architecture.rb index f126ac4f4de..f866ef411a3 100644 --- a/packages/react-native/scripts/cocoapods/new_architecture.rb +++ b/packages/react-native/scripts/cocoapods/new_architecture.rb @@ -32,6 +32,13 @@ class NewArchitectureHelper config.build_settings[cxxBuildsettingsName] = Helpers::Constants::cxx_language_standard end end + + # Override targets that would set spec.xcconfig to define c++ version + installer.aggregate_targets.each do |aggregate_target| + aggregate_target.xcconfigs.each do |config_name, config_file| + config_file.attributes[cxxBuildsettingsName] = Helpers::Constants::cxx_language_standard + end + end end def self.computeFlags(is_new_arch_enabled)