Skip to content

Commit

Permalink
Make sure that all the pods in a project use the same C++ version (#4…
Browse files Browse the repository at this point in the history
…6787)

Summary:
Pull Request resolved: #46787

This issue was raised by a some partner that were integrating with libraries that were setting the wrong C++ version.

With this change, RN takes ownership of the version of C++ that must be supported.

## Changelog
[iOS][Breaking] - Cocoapods decide the C++ version for iOS pods

Reviewed By: blakef

Differential Revision: D63760271

fbshipit-source-id: 5e629c61accd97fb10a199430d31e8b4c73d482b
  • Loading branch information
cipolleschi authored and facebook-github-bot committed Oct 4, 2024
1 parent 309cdea commit bd50c4a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/react-native/scripts/cocoapods/new_architecture.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,26 @@ class NewArchitectureHelper
@@NewArchWarningEmitted = false # Used not to spam warnings to the user.

def self.set_clang_cxx_language_standard_if_needed(installer)
cxxBuildsettingsName = "CLANG_CXX_LANGUAGE_STANDARD"
projects = installer.aggregate_targets
.map{ |t| t.user_project }
.uniq{ |p| p.path }

projects.each do |project|
Pod::UI.puts("Setting CLANG_CXX_LANGUAGE_STANDARD to #{ Helpers::Constants::cxx_language_standard } on #{ project.path }")
Pod::UI.puts("Setting #{cxxBuildsettingsName} to #{ Helpers::Constants::cxx_language_standard } on #{ project.path }")

project.build_configurations.each do |config|
config.build_settings["CLANG_CXX_LANGUAGE_STANDARD"] = Helpers::Constants::cxx_language_standard
config.build_settings[cxxBuildsettingsName] = Helpers::Constants::cxx_language_standard
end

project.save()
end

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|
config.build_settings[cxxBuildsettingsName] = Helpers::Constants::cxx_language_standard
end
end
end

def self.computeFlags(is_new_arch_enabled)
Expand Down

0 comments on commit bd50c4a

Please sign in to comment.