Skip to content

Commit

Permalink
fix(iOS): move boost compiler flags and folly dep name to centralized…
Browse files Browse the repository at this point in the history
… config (#46513)

Summary:
This PR does some further cleanup on the flags passed to cocoapods.

I've moved `boost_compiler_flags` and `folly_dep_name` to `helpers.rb` file.

## Changelog:

[INTERNAL] [FIXED] -  move boost compiler flags and folly dep name to centralized config

Pull Request resolved: #46513

Test Plan: CI Green

Reviewed By: cortinico

Differential Revision: D62846105

Pulled By: cipolleschi

fbshipit-source-id: dff07ddb49f1f4b559125f2ed8508b32f08d4975
  • Loading branch information
okwasniewski authored and facebook-github-bot committed Sep 17, 2024
1 parent e82743c commit 3c17bea
Show file tree
Hide file tree
Showing 23 changed files with 61 additions and 38 deletions.
3 changes: 2 additions & 1 deletion packages/react-native/React-Core.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ folly_version = folly_config[:version]
socket_rocket_config = get_socket_rocket_config()
socket_rocket_version = socket_rocket_config[:version]

boost_compiler_flags = '-Wno-documentation'
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]

use_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1'
use_hermes_flag = use_hermes ? "-DUSE_HERMES=1" : ""
Expand Down
3 changes: 2 additions & 1 deletion packages/react-native/React/React-RCTFabric.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ end
folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]
boost_compiler_flags = '-Wno-documentation'
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]
new_arch_flags = ENV['RCT_NEW_ARCH_ENABLED'] == '1' ? ' -DRCT_NEW_ARCH_ENABLED=1' : ''

header_search_paths = [
Expand Down
5 changes: 3 additions & 2 deletions packages/react-native/ReactCommon/React-Fabric.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ end
folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]
folly_dep_name = folly_config[:dep_name]

folly_dep_name = 'RCT-Folly/Fabric'
boost_compiler_flags = '-Wno-documentation'
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]
react_native_path = ".."

Pod::Spec.new do |s|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ end
folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]
folly_dep_name = folly_config[:dep_name]

folly_dep_name = 'RCT-Folly/Fabric'
boost_compiler_flags = '-Wno-documentation'
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]
react_native_path = ".."

Pod::Spec.new do |s|
Expand Down
5 changes: 3 additions & 2 deletions packages/react-native/ReactCommon/React-FabricImage.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ end
folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]
folly_dep_name = folly_config[:dep_name]

folly_dep_name = 'RCT-Folly/Fabric'
boost_compiler_flags = '-Wno-documentation'
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]
react_native_path = ".."

header_search_path = [
Expand Down
5 changes: 3 additions & 2 deletions packages/react-native/ReactCommon/ReactCommon.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ end
folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]

boost_compiler_flags = '-Wno-documentation'
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]
using_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == "1"

Pod::Spec.new do |s|
s.name = "ReactCommon"
s.module_name = "ReactCommon"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ else
source[:tag] = "v#{version}"
end

folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]

boost_compiler_flags = '-Wno-documentation'

Pod::Spec.new do |s|
s.name = "React-callinvoker"
s.version = version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ end
folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]
boost_compiler_flags = '-Wno-documentation'
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]

Pod::Spec.new do |s|
s.name = "React-cxxreact"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ end
folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]
boost_compiler_flags = '-Wno-documentation'
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]

Pod::Spec.new do |s|
s.name = "React-hermes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ end
folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]
folly_dep_name = 'RCT-Folly/Fabric'
boost_compiler_flags = '-Wno-documentation'
folly_dep_name = folly_config[:dep_name]

boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]
react_native_path = ".."

Pod::Spec.new do |s|
Expand Down
3 changes: 2 additions & 1 deletion packages/react-native/ReactCommon/jsi/React-jsi.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ end
folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]
boost_compiler_flags = '-Wno-documentation'
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]

Pod::Spec.new do |s|
s.name = "React-jsi"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ end
folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]
boost_compiler_flags = '-Wno-documentation'
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]

Pod::Spec.new do |s|
s.name = "React-jsiexecutor"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ end
folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]
boost_compiler_flags = '-Wno-documentation'
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]

Pod::Spec.new do |s|
s.name = "React-logger"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]

boost_compiler_flags = '-Wno-documentation'
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]

using_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == "1"

Pod::Spec.new do |s|
s.name = "React-NativeModulesApple"
s.module_name = "React_NativeModulesApple"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]

boost_compiler_flags = '-Wno-documentation'
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]
using_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == "1"

header_search_paths = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]

boost_compiler_flags = '-Wno-documentation'
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]

Pod::Spec.new do |s|
source_files = "**/*.{m,mm,cpp,h}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ else
source[:tag] = "v#{version}"
end

folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -Wno-comma -Wno-shorten-64-to-32'
boost_compiler_flags = '-Wno-documentation'
folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]

Pod::Spec.new do |s|
source_files = "**/*.{m,mm,cpp,h}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ end
folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]
folly_dep_name = folly_config[:dep_name]

folly_dep_name = 'RCT-Folly/Fabric'
boost_compiler_flags = '-Wno-documentation'
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]

Pod::Spec.new do |s|
s.name = "React-RuntimeCore"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ end
folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]
folly_dep_name = 'RCT-Folly/Fabric'
boost_compiler_flags = '-Wno-documentation'
folly_dep_name = folly_config[:dep_name]

boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]

Pod::Spec.new do |s|
s.name = "React-RuntimeHermes"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ end
folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]
folly_dep_name = 'RCT-Folly/Fabric'
boost_compiler_flags = '-Wno-documentation'
folly_dep_name = folly_config[:dep_name]

boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]

header_search_paths = [
"$(PODS_ROOT)/boost",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ end
folly_config = get_folly_config()
folly_compiler_flags = folly_config[:compiler_flags]
folly_version = folly_config[:version]
boost_compiler_flags = '-Wno-documentation'
boost_config = get_boost_config()
boost_compiler_flags = boost_config[:compiler_flags]

Pod::Spec.new do |s|
s.name = "React-runtimeexecutor"
Expand Down
5 changes: 3 additions & 2 deletions packages/react-native/scripts/cocoapods/codegen_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ def get_react_codegen_spec(package_json_file, folly_version: get_folly_config()[
package = JSON.parse(file_manager.read(package_json_file))
version = package['version']
use_frameworks = ENV['USE_FRAMEWORKS'] != nil
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -Wno-comma -Wno-shorten-64-to-32'
boost_compiler_flags = '-Wno-documentation'

folly_compiler_flags = get_folly_config()[:compiler_flags]
boost_compiler_flags = get_boost_config()[:compiler_flags]

header_search_paths = [
"\"$(PODS_ROOT)/boost\"",
Expand Down
4 changes: 3 additions & 1 deletion packages/react-native/scripts/cocoapods/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module Helpers
class Constants
@@boost_config = {
:git => "https://github.com/react-native-community/boost-for-react-native",
:compiler_flags => '-Wno-documentation'
}

@@socket_rocket_config = {
Expand All @@ -48,7 +49,8 @@ class Constants
@@folly_config = {
:version => '2024.01.01.00',
:git => 'https://github.com/facebook/folly.git',
:compiler_flags => '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -Wno-comma -Wno-shorten-64-to-32'
:compiler_flags => '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -Wno-comma -Wno-shorten-64-to-32',
:dep_name => 'RCT-Folly/Fabric'
}

@@fmt_config = {
Expand Down

0 comments on commit 3c17bea

Please sign in to comment.