Skip to content

Commit 435e9e1

Browse files
committed
add dummy cpp file to cxxstableapi and link cxxstableapi to react-native-fantom
1 parent b7ed0e1 commit 435e9e1

3 files changed

Lines changed: 29 additions & 1 deletion

File tree

‎packages/react-native/ReactCommon/react/cxxstableapi/React-cxxstableapi.podspec‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Pod::Spec.new do |s|
2525
s.author = "Meta Platforms, Inc. and its affiliates"
2626
s.platforms = min_supported_versions
2727
s.source = source
28-
s.source_files = podspec_sources("*.h", "*.h")
28+
s.source_files = podspec_sources("*.{cpp,h}", "*.h")
2929
s.header_dir = "react/cxxstableapi"
3030
s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
3131
"DEFINES_MODULE" => "YES" }
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
// The cxxstableapi guards are pure preprocessor headers, so this module has
9+
// nothing to compile. CocoaPods, however, emits a PBXAggregateTarget for a pod
10+
// with no compilable sources, and an aggregate target produces no .framework
11+
// under `use_frameworks!`. Dependents' header search paths point at
12+
// `React_cxxstableapi.framework/Headers`, so without a framework every
13+
// `#include <react/cxxstableapi/*.h>` fails to resolve.
14+
//
15+
// This translation unit exists solely to keep the pod a real framework target.
16+
// It is deliberately empty apart from the anchor below, which keeps the
17+
// resulting object file non-empty for linkers that object to one.
18+
19+
namespace facebook::react {
20+
21+
namespace {
22+
[[maybe_unused]] const char* stableApiAnchor() {
23+
return "react/cxxstableapi";
24+
}
25+
} // namespace
26+
27+
} // namespace facebook::react

‎private/react-native-fantom/tester/CMakeLists.txt‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ add_react_common_subdir(jsitooling)
5858
add_react_common_subdir(logger)
5959
add_react_common_subdir(oscompat)
6060
add_react_common_subdir(react/bridging)
61+
add_react_common_subdir(react/cxxstableapi)
6162
add_react_common_subdir(react/debug)
6263
add_react_common_subdir(react/featureflags)
6364
add_react_common_subdir(react/nativemodule/core)

0 commit comments

Comments
 (0)