From 693902151899c85ff00418d75df4377a1096efee Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Fri, 16 Feb 2024 23:31:39 +0000 Subject: [PATCH] [RN][iOS] Improve Swift support for 3rd party libs (#42075) --- packages/react-native/ReactCommon/React-Fabric.podspec | 3 ++- .../ReactCommon/react/debug/React-debug.podspec | 5 ++++- .../react/renderer/graphics/React-graphics.podspec | 6 +++++- .../ReactCommon/react/utils/React-utils.podspec | 4 +++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/packages/react-native/ReactCommon/React-Fabric.podspec b/packages/react-native/ReactCommon/React-Fabric.podspec index 0644c97ba22b5c..f6a9217ff62e12 100644 --- a/packages/react-native/ReactCommon/React-Fabric.podspec +++ b/packages/react-native/ReactCommon/React-Fabric.podspec @@ -33,7 +33,8 @@ Pod::Spec.new do |s| s.source = source s.source_files = "dummyFile.cpp" s.pod_target_xcconfig = { "USE_HEADERMAP" => "YES", - "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" } + "CLANG_CXX_LANGUAGE_STANDARD" => "c++17", + "DEFINES_MODULE" => "YES" } if ENV['USE_FRAMEWORKS'] s.header_mappings_dir = './' diff --git a/packages/react-native/ReactCommon/react/debug/React-debug.podspec b/packages/react-native/ReactCommon/react/debug/React-debug.podspec index dab4a31652edfa..e5c0f885fcb053 100644 --- a/packages/react-native/ReactCommon/react/debug/React-debug.podspec +++ b/packages/react-native/ReactCommon/react/debug/React-debug.podspec @@ -27,7 +27,10 @@ Pod::Spec.new do |s| s.source = source s.source_files = "**/*.{cpp,h}" s.header_dir = "react/debug" - s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => "c++17" } + s.pod_target_xcconfig = { + "CLANG_CXX_LANGUAGE_STANDARD" => "c++17", + "DEFINES_MODULE" => "YES" + } if ENV['USE_FRAMEWORKS'] s.module_name = "React_debug" diff --git a/packages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec b/packages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec index 19cc4ea84a7acf..5d034bd751228d 100644 --- a/packages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec +++ b/packages/react-native/ReactCommon/react/renderer/graphics/React-graphics.podspec @@ -49,7 +49,11 @@ Pod::Spec.new do |s| header_search_paths = header_search_paths + ["\"$(PODS_TARGET_SRCROOT)/platform/ios\""] end - s.pod_target_xcconfig = { "USE_HEADERMAP" => "NO", "HEADER_SEARCH_PATHS" => header_search_paths.join(" ") } + s.pod_target_xcconfig = { + "USE_HEADERMAP" => "NO", + "HEADER_SEARCH_PATHS" => header_search_paths.join(" "), + "DEFINES_MODULE" => "YES" + } s.dependency "glog" s.dependency "RCT-Folly/Fabric", folly_version diff --git a/packages/react-native/ReactCommon/react/utils/React-utils.podspec b/packages/react-native/ReactCommon/react/utils/React-utils.podspec index d262c559241052..d4ea2ddd7b0222 100644 --- a/packages/react-native/ReactCommon/react/utils/React-utils.podspec +++ b/packages/react-native/ReactCommon/react/utils/React-utils.podspec @@ -44,7 +44,9 @@ Pod::Spec.new do |s| s.exclude_files = "tests" s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => "c++17", - "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')} + "HEADER_SEARCH_PATHS" => header_search_paths.join(' '), + "DEFINES_MODULE" => "YES" + } if ENV['USE_FRAMEWORKS'] s.module_name = "React_utils"