Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/react-native/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,10 @@ extension Target {
(REMOVE_LEGACY_MODULE_INTEROP ? [.define("RCT_REMOVE_LEGACY_MODULE_INTEROP", to: "1")] : [])
+ (REMOVE_LEGACY_COMPONENT_INTEROP ? [.define("RCT_REMOVE_LEGACY_COMPONENT_INTEROP", to: "1")] : [])

// Every target built through this factory is React Native's own, so RN_BUILDING
// keeps the react/cxxstableapi guards inert for internal sources. cxxSettings are
// per-target and are not inherited by packages that depend on React, so this does
// not exempt consumers from the guards.
let cxxSettings =
[
.unsafeFlags(["-std=c++20"]),
Expand All @@ -967,6 +971,7 @@ extension Target {
.define("USE_HERMES", to: "1"),
.define("RCT_REMOVE_LEGACY_ARCH", to: "1"),
.define("HERMES_V1_ENABLED", to: "1"),
.define("RN_BUILDING", to: "1"),
] + legacyInteropDefines + defines + cxxCommonHeaderPaths

return .target(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ add_react_third_party_ndk_subdir(fast_float)
add_react_third_party_ndk_subdir(fmt)
add_react_third_party_ndk_subdir(folly)

# Marks everything added below as React Native's own build, so the
# react/cxxstableapi guards let internal sources keep including the
# fine-grained headers they fence off from consumers. Deliberately declared
# after the third-party subdirectories so it never reaches them, and this
# project never compiles app or third-party module code (those build against
# the prefab artifacts through ReactNative-application.cmake).
add_compile_definitions(RN_BUILDING)

# Common targets
add_react_common_subdir(yoga)
add_react_common_subdir(runtimeexecutor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Pod::Spec.new do |s|
s.author = "Meta Platforms, Inc. and its affiliates"
s.platforms = min_supported_versions
s.source = source
s.source_files = podspec_sources("*.h", "*.h")
s.source_files = podspec_sources("*.{cpp,h}", "*.h")
s.header_dir = "react/cxxstableapi"
s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
"DEFINES_MODULE" => "YES" }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* 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.
*/

// Anchor translation unit for the `react/cxxstableapi` pod.
//
// The guards in this module are pure preprocessor headers, so the pod would
// otherwise ship no compilable source. CocoaPods emits a PBXAggregateTarget for
// a pod with no compilable sources, and an aggregate target produces no
// `.framework` under `use_frameworks!` — dependents are then unable to resolve
// the guard headers. Giving the pod a single source file forces CocoaPods to
// emit a real framework target instead.
//
// This file intentionally declares nothing: `react/cxxstableapi` has no runtime
// API, only preprocessor guards. Do not add code here.
1 change: 1 addition & 0 deletions private/react-native-fantom/tester/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ add_react_common_subdir(jsitooling)
add_react_common_subdir(logger)
add_react_common_subdir(oscompat)
add_react_common_subdir(react/bridging)
add_react_common_subdir(react/cxxstableapi)
add_react_common_subdir(react/debug)
add_react_common_subdir(react/featureflags)
add_react_common_subdir(react/nativemodule/core)
Expand Down
Loading