From 0b67218a8ae7904bb240dad599b9c33e8b1e705e Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Thu, 20 Feb 2025 06:31:34 -0800 Subject: [PATCH] Add dummy cpp for renderercss (#49553) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/49553 The new React-renderercss pod is an header only pod. These are not allowed by Cocoapods, because it will not materialize the framework when building with then turned on. the solution is to just add an empty source file to frorce cocoapods to materialize the .framework file and solve the dependency graph properly. ## Changelog: [Internal] - Add dummy file to React-renderercss Reviewed By: huntie Differential Revision: D69920318 fbshipit-source-id: e5cc092a480f7c86eeb295ed966f85b6f55fdc54 --- .../react-native/React/React-RCTFabric.podspec | 1 + .../ReactCommon/react/renderer/css/CSSDummy.cpp | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 packages/react-native/ReactCommon/react/renderer/css/CSSDummy.cpp diff --git a/packages/react-native/React/React-RCTFabric.podspec b/packages/react-native/React/React-RCTFabric.podspec index 70f458f5271..7863a0decb8 100644 --- a/packages/react-native/React/React-RCTFabric.podspec +++ b/packages/react-native/React/React-RCTFabric.podspec @@ -98,6 +98,7 @@ Pod::Spec.new do |s| add_dependency(s, "React-RCTAnimation", :framework_name => 'RCTAnimation') add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern') add_dependency(s, "React-jsinspectortracing", :framework_name => 'jsinspector_moderntracing') + add_dependency(s, "React-renderercss") depend_on_js_engine(s) diff --git a/packages/react-native/ReactCommon/react/renderer/css/CSSDummy.cpp b/packages/react-native/ReactCommon/react/renderer/css/CSSDummy.cpp new file mode 100644 index 00000000000..0ca88ca8091 --- /dev/null +++ b/packages/react-native/ReactCommon/react/renderer/css/CSSDummy.cpp @@ -0,0 +1,14 @@ +/* + * 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. + */ + +// This file is required for the CSS podpsec because this is a header-files only +// module. Headers file only modules are not supported by Cocoapods when +// building in dynamic framework mode. In that case, the dynamicFramework is not +// generated because there is no binary to generate. This means that other +// frameworks that depends on this will not find the headers they need. Adding a +// simple empty dummy source file forces Cocoapods to generate the frameworks +// and fixes the issue.