diff --git a/packages/react-native/ReactAndroid/build.gradle.kts b/packages/react-native/ReactAndroid/build.gradle.kts index 894212355383..d932500e6596 100644 --- a/packages/react-native/ReactAndroid/build.gradle.kts +++ b/packages/react-native/ReactAndroid/build.gradle.kts @@ -186,6 +186,7 @@ val preparePrefab by ), // runtimeexecutor Pair("../ReactCommon/runtimeexecutor/", ""), + Pair("../ReactCommon/runtimeexecutor/platform/cxx/", ""), // react_renderer_textlayoutmanager Pair( "../ReactCommon/react/renderer/textlayoutmanager/", diff --git a/packages/react-native/ReactCommon/runtimeexecutor/CMakeLists.txt b/packages/react-native/ReactCommon/runtimeexecutor/CMakeLists.txt index 6a1a14d29924..a341608aa7c3 100644 --- a/packages/react-native/ReactCommon/runtimeexecutor/CMakeLists.txt +++ b/packages/react-native/ReactCommon/runtimeexecutor/CMakeLists.txt @@ -14,6 +14,6 @@ add_library(runtimeexecutor OBJECT ${runtimeexecutor_SRC}) target_include_directories(runtimeexecutor PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/platform/cxx) -target_link_libraries(runtimeexecutor jsi) +target_link_libraries(runtimeexecutor jsi react_cxxstableapi) target_compile_reactnative_options(runtimeexecutor PRIVATE) target_compile_options(runtimeexecutor PRIVATE -Wpedantic) diff --git a/packages/react-native/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec b/packages/react-native/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec index 6ad619fadd7d..13a14bc82081 100644 --- a/packages/react-native/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec +++ b/packages/react-native/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec @@ -31,10 +31,14 @@ Pod::Spec.new do |s| s.platforms = min_supported_versions s.source = source s.source_files = podspec_sources(["ReactCommon/*.{m,mm,cpp,h}", "platform/ios/**/*.{m,mm,cpp,h}"], ["ReactCommon/*.h", "platform/ios/**/*.h"]) + s.exclude_files = ["React"] s.header_dir = "ReactCommon" if ENV['USE_FRAMEWORKS'] - header_search_paths = header_search_paths + ["\"$(PODS_TARGET_SRCROOT)/platform/ios\""] + header_search_paths = header_search_paths + [ + "\"$(PODS_TARGET_SRCROOT)/platform/ios\"", + "\"$(PODS_TARGET_SRCROOT)/..\"", # ReactCommon, for + ] end resolve_use_frameworks(s, header_mappings_dir: ".") @@ -48,10 +52,17 @@ Pod::Spec.new do |s| add_rncore_dependency(s) s.dependency "React-jsi", version + s.dependency "React-cxxstableapi" add_dependency(s, "React-featureflags") add_dependency(s, "React-debug") add_dependency(s, "React-utils", :additional_framework_paths => ["react/utils/platform/ios"]) + s.subspec "runtimeexecutorUmbrella" do |ss| + ss.source_files = "React/*.h" + ss.header_dir = "" + ss.header_mappings_dir = "." + end + mark_as_react_native_build(s) end diff --git a/packages/react-native/ReactCommon/runtimeexecutor/React/RuntimeExecutor.h b/packages/react-native/ReactCommon/runtimeexecutor/React/RuntimeExecutor.h new file mode 100644 index 000000000000..52e09e56a792 --- /dev/null +++ b/packages/react-native/ReactCommon/runtimeexecutor/React/RuntimeExecutor.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +// ============================================================================= +// Umbrella header for the `runtimeexecutor` module - public entry point. +// +// #include +// +// Re-exports the module's public interface headers. React Native's own code +// should keep using the fine-grained `` includes; only outside +// consumers use this umbrella. +// ============================================================================= + +// Marks that the following headers are pulled in through the umbrella, so their +// shared guard () accepts them. The marker +// is saved and restored rather than defined and undefined: the scope ends at +// this block, so later *direct* includes in the same TU are still caught, and +// it nests inside an enclosing umbrella rather than disarming it. +#pragma push_macro("RN_UMBRELLA_CONTEXT") +#undef RN_UMBRELLA_CONTEXT +#define RN_UMBRELLA_CONTEXT 1 + +#include +#include + +#undef RN_UMBRELLA_CONTEXT +#pragma pop_macro("RN_UMBRELLA_CONTEXT") diff --git a/packages/react-native/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h b/packages/react-native/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h index 999e38c31344..e4a889902ac2 100644 --- a/packages/react-native/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h +++ b/packages/react-native/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h @@ -7,6 +7,8 @@ #pragma once +#include + #include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/runtimeexecutor/platform/cxx/ReactCommon/RuntimeExecutorSyncUIThreadUtils.h b/packages/react-native/ReactCommon/runtimeexecutor/platform/cxx/ReactCommon/RuntimeExecutorSyncUIThreadUtils.h index fd74c21261b5..b00947293146 100644 --- a/packages/react-native/ReactCommon/runtimeexecutor/platform/cxx/ReactCommon/RuntimeExecutorSyncUIThreadUtils.h +++ b/packages/react-native/ReactCommon/runtimeexecutor/platform/cxx/ReactCommon/RuntimeExecutorSyncUIThreadUtils.h @@ -7,6 +7,8 @@ #pragma once +#include + #include #include diff --git a/packages/react-native/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.h b/packages/react-native/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.h index 17d78acf2a86..e4b5f5e2744b 100644 --- a/packages/react-native/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.h +++ b/packages/react-native/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.h @@ -7,6 +7,8 @@ #pragma once +#include + #include #include diff --git a/packages/react-native/scripts/ios-prebuild/headers-config.js b/packages/react-native/scripts/ios-prebuild/headers-config.js index 80afb933123c..89a4b6025447 100644 --- a/packages/react-native/scripts/ios-prebuild/headers-config.js +++ b/packages/react-native/scripts/ios-prebuild/headers-config.js @@ -585,6 +585,24 @@ const PodspecExceptions /*: {[key: string]: PodSpecConfiguration} */ = { 'Libraries/PushNotificationIOS/React-RCTPushNotification.podspec': { disabled: true, }, + 'ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec': { + name: 'React-runtimeexecutor', + headerPatterns: [], + headerDir: '', + subSpecs: [ + { + name: 'runtimeexecutor', + headerPatterns: ['ReactCommon/*.h', 'platform/ios/**/*.h'], + excludePatterns: ['React'], + headerDir: 'ReactCommon', + }, + { + name: 'runtimeexecutorUmbrella', + headerPatterns: ['React/*.h'], + headerDir: 'React', + }, + ], + }, }; module.exports = {PodspecExceptions};