From f9332f2fea41441900d5f3e938f144d0944ffc5e Mon Sep 17 00:00:00 2001 From: Andrew Datsenko Date: Fri, 20 Jun 2025 12:08:56 -0700 Subject: [PATCH 01/15] Gate RN_SERIALIZABLE_STATE behind ANDROID flag (#52155) Summary: Changelog: [Internal] Gating RN_SERIALIZABLE_STATE behind ANDROID flag so we can build ReactCommon with cmake when targeting different platforms. This will help build reac-native-fantom for OSS. Reviewed By: christophpurrer Differential Revision: D77034689 --- .../ReactCommon/cmake-utils/react-native-flags.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/react-native/ReactCommon/cmake-utils/react-native-flags.cmake b/packages/react-native/ReactCommon/cmake-utils/react-native-flags.cmake index ae97237881c200..d005a4e0b0d89e 100644 --- a/packages/react-native/ReactCommon/cmake-utils/react-native-flags.cmake +++ b/packages/react-native/ReactCommon/cmake-utils/react-native-flags.cmake @@ -28,6 +28,8 @@ SET(reactnative_FLAGS function(target_compile_reactnative_options target_name scope) target_compile_options(${target_name} ${scope} ${reactnative_FLAGS}) - target_compile_definitions(${target_name} ${scope} RN_SERIALIZABLE_STATE) + # TODO T228344694 improve this so that it works for all platforms + if(ANDROID) + target_compile_definitions(${target_name} ${scope} RN_SERIALIZABLE_STATE) + endif() endfunction() - From 020d4490d285f34d3a40b47d582911600c20ec3d Mon Sep 17 00:00:00 2001 From: Andrew Datsenko Date: Fri, 20 Jun 2025 12:08:56 -0700 Subject: [PATCH 02/15] Fix cmake build for devtoolsruntimesettings (#52156) Summary: Changelog: [Internal] Fix devtoolsruntimesettings lib as it needs to be OBJECT library as it has source code included. Reviewed By: christophpurrer Differential Revision: D77035122 --- .../ReactCommon/devtoolsruntimesettings/CMakeLists.txt | 10 +++++----- .../devtoolsruntimesettings/CMakeLists.txt | 2 +- .../DevToolsRuntimeSettingsModule.cpp | 2 ++ .../DevToolsRuntimeSettingsModule.h | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/react-native/ReactCommon/devtoolsruntimesettings/CMakeLists.txt b/packages/react-native/ReactCommon/devtoolsruntimesettings/CMakeLists.txt index 3be3a96bedddea..1585b1dea0e5b0 100644 --- a/packages/react-native/ReactCommon/devtoolsruntimesettings/CMakeLists.txt +++ b/packages/react-native/ReactCommon/devtoolsruntimesettings/CMakeLists.txt @@ -8,10 +8,10 @@ set(CMAKE_VERBOSE_MAKEFILE on) include(${REACT_COMMON_DIR}/cmake-utils/react-native-flags.cmake) -add_library(react_devtoolsruntimesettingscxx INTERFACE) +file(GLOB devtoolsruntimesettings_SRCS *.cpp) +add_library(devtoolsruntimesettings OBJECT ${devtoolsruntimesettings_SRCS}) -target_include_directories(react_devtoolsruntimesettingscxx INTERFACE .) +target_include_directories(devtoolsruntimesettings PUBLIC .) -target_link_libraries(react_devtoolsruntimesettingscxx jsi) -target_compile_reactnative_options(react_devtoolsruntimesettingscxx PRIVATE) -target_compile_options(react_devtoolsruntimesettingscxx PRIVATE -Wpedantic) +target_link_libraries(devtoolsruntimesettings jsi react_codegen_rncore) +target_compile_reactnative_options(devtoolsruntimesettings PRIVATE) diff --git a/packages/react-native/ReactCommon/react/nativemodule/devtoolsruntimesettings/CMakeLists.txt b/packages/react-native/ReactCommon/react/nativemodule/devtoolsruntimesettings/CMakeLists.txt index 8666ad0080fd3d..dc4e1497c4e071 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/devtoolsruntimesettings/CMakeLists.txt +++ b/packages/react-native/ReactCommon/react/nativemodule/devtoolsruntimesettings/CMakeLists.txt @@ -14,7 +14,7 @@ add_library(react_nativemodule_devtoolsruntimesettings OBJECT ${react_nativemodu target_include_directories(react_nativemodule_devtoolsruntimesettings PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(react_nativemodule_devtoolsruntimesettings - react_devtoolsruntimesettingscxx + devtoolsruntimesettings ) target_compile_reactnative_options(react_nativemodule_devtoolsruntimesettings PRIVATE) target_compile_options(react_nativemodule_devtoolsruntimesettings PRIVATE -Wpedantic) diff --git a/packages/react-native/ReactCommon/react/nativemodule/devtoolsruntimesettings/DevToolsRuntimeSettingsModule.cpp b/packages/react-native/ReactCommon/react/nativemodule/devtoolsruntimesettings/DevToolsRuntimeSettingsModule.cpp index 4b0e5ca0bd2f6a..eac8accbe97c53 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/devtoolsruntimesettings/DevToolsRuntimeSettingsModule.cpp +++ b/packages/react-native/ReactCommon/react/nativemodule/devtoolsruntimesettings/DevToolsRuntimeSettingsModule.cpp @@ -6,7 +6,9 @@ */ #include "DevToolsRuntimeSettingsModule.h" +#if RN_DISABLE_OSS_PLUGIN_HEADER #include "Plugins.h" +#endif std::shared_ptr ReactDevToolsRuntimeSettingsModuleProvider( diff --git a/packages/react-native/ReactCommon/react/nativemodule/devtoolsruntimesettings/DevToolsRuntimeSettingsModule.h b/packages/react-native/ReactCommon/react/nativemodule/devtoolsruntimesettings/DevToolsRuntimeSettingsModule.h index 6f4d54aeb1c70c..ef674bcef307f2 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/devtoolsruntimesettings/DevToolsRuntimeSettingsModule.h +++ b/packages/react-native/ReactCommon/react/nativemodule/devtoolsruntimesettings/DevToolsRuntimeSettingsModule.h @@ -7,7 +7,7 @@ #pragma once -#include "devtoolsruntimesettingscxx/DevToolsRuntimeSettings.h" +#include namespace facebook::react { From 2a2b603e052753a5b844c35326110e08cef4fbb4 Mon Sep 17 00:00:00 2001 From: Andrew Datsenko Date: Fri, 20 Jun 2025 12:08:56 -0700 Subject: [PATCH 03/15] Create `react/nativemodule/cputime/CMakeLists.txt` (#52157) Summary: Changelog: [Internal] Add CMakeLists for `react/nativemodule/cputime` Reviewed By: christophpurrer Differential Revision: D77035337 --- .../react/nativemodule/cputime/CMakeLists.txt | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 packages/react-native/ReactCommon/react/nativemodule/cputime/CMakeLists.txt diff --git a/packages/react-native/ReactCommon/react/nativemodule/cputime/CMakeLists.txt b/packages/react-native/ReactCommon/react/nativemodule/cputime/CMakeLists.txt new file mode 100644 index 00000000000000..dd00455428735b --- /dev/null +++ b/packages/react-native/ReactCommon/react/nativemodule/cputime/CMakeLists.txt @@ -0,0 +1,20 @@ +# 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. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +include(${REACT_COMMON_DIR}/cmake-utils/react-native-flags.cmake) + +file(GLOB react_nativemodule_cpu_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_nativemodule_cpu OBJECT ${react_nativemodule_cpu_SRC}) + +target_include_directories(react_nativemodule_cpu PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(react_nativemodule_cpu + react_codegen_rncore +) +target_compile_reactnative_options(react_nativemodule_cpu PRIVATE) +target_compile_options(react_nativemodule_cpu PRIVATE -Wpedantic) From 2a7ef1047e48dbd7dc0e06e70f9784a12e6ca852 Mon Sep 17 00:00:00 2001 From: Andrew Datsenko Date: Fri, 20 Jun 2025 12:08:56 -0700 Subject: [PATCH 04/15] RN] Add missing link libraries for react_nativemodule_defaults (#52158) Summary: Changelog: [Internal] As title Reviewed By: christophpurrer Differential Revision: D77035424 --- .../ReactCommon/react/nativemodule/defaults/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-native/ReactCommon/react/nativemodule/defaults/CMakeLists.txt b/packages/react-native/ReactCommon/react/nativemodule/defaults/CMakeLists.txt index 1b495bac400af3..731b4c4930eb1c 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/defaults/CMakeLists.txt +++ b/packages/react-native/ReactCommon/react/nativemodule/defaults/CMakeLists.txt @@ -14,6 +14,8 @@ add_library(react_nativemodule_defaults OBJECT ${react_nativemodule_defaults_SRC target_include_directories(react_nativemodule_defaults PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(react_nativemodule_defaults + react_codegen_rncore + react_nativemodule_core react_nativemodule_dom react_nativemodule_devtoolsruntimesettings react_nativemodule_featureflags From a0d642c17674a48ed572b401d8063b40cdbcb0d2 Mon Sep 17 00:00:00 2001 From: Andrew Datsenko Date: Fri, 20 Jun 2025 12:08:56 -0700 Subject: [PATCH 05/15] Add react_nativemodule_fantomspecificmethods cmake (#52159) Summary: Changelog: [Internal] Add missing cmake target for react_nativemodule_fantomspecificmethods Reviewed By: christophpurrer Differential Revision: D77035521 --- .../fantomtestspecificmethods/CMakeLists.txt | 29 +++++++++++++++++++ .../NativeFantomTestSpecificMethods.cpp | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 packages/react-native/ReactCommon/react/nativemodule/fantomtestspecificmethods/CMakeLists.txt diff --git a/packages/react-native/ReactCommon/react/nativemodule/fantomtestspecificmethods/CMakeLists.txt b/packages/react-native/ReactCommon/react/nativemodule/fantomtestspecificmethods/CMakeLists.txt new file mode 100644 index 00000000000000..31cdedc8ea08a6 --- /dev/null +++ b/packages/react-native/ReactCommon/react/nativemodule/fantomtestspecificmethods/CMakeLists.txt @@ -0,0 +1,29 @@ +# 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. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +include(${REACT_COMMON_DIR}/cmake-utils/react-native-flags.cmake) + +file(GLOB react_nativemodule_webperformance_SRC CONFIGURE_DEPENDS *.cpp internal/*.cpp) +add_library(react_nativemodule_fantomspecificmethods OBJECT ${react_nativemodule_webperformance_SRC}) + +target_include_directories(react_nativemodule_fantomspecificmethods PUBLIC ${REACT_COMMON_DIR}) +target_include_directories(react_nativemodule_fantomspecificmethods PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/internal) + +target_link_libraries(react_nativemodule_fantomspecificmethods + react_codegen_rncore + react_cxxreact + react_renderer_bridging + react_renderer_core + react_renderer_graphics + react_renderer_observers_intersection + react_renderer_runtimescheduler + react_renderer_uimanager + rrc_view +) +target_compile_reactnative_options(react_nativemodule_fantomspecificmethods PRIVATE) +target_compile_options(react_nativemodule_fantomspecificmethods PRIVATE -Wpedantic -Wno-deprecated-declarations) diff --git a/packages/react-native/ReactCommon/react/nativemodule/fantomtestspecificmethods/NativeFantomTestSpecificMethods.cpp b/packages/react-native/ReactCommon/react/nativemodule/fantomtestspecificmethods/NativeFantomTestSpecificMethods.cpp index d88166c948c6a5..660eda79b20c7d 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/fantomtestspecificmethods/NativeFantomTestSpecificMethods.cpp +++ b/packages/react-native/ReactCommon/react/nativemodule/fantomtestspecificmethods/NativeFantomTestSpecificMethods.cpp @@ -11,7 +11,9 @@ #include "internal/FantomForcedCloneCommitHook.h" +#if RN_DISABLE_OSS_PLUGIN_HEADER #include "Plugins.h" +#endif std::shared_ptr NativeFantomTestSpecificMethodsModuleProvider( From 25b579143694210bb3887e6805fa7e0001a2a588 Mon Sep 17 00:00:00 2001 From: Andrew Datsenko Date: Fri, 20 Jun 2025 12:08:56 -0700 Subject: [PATCH 06/15] add react_nativemodule_intersectionobserver cmake (#52160) Summary: Changelog: [Internal] Add missing cmake lib for react_nativemodule_intersectionobserver Differential Revision: D77035609 --- .../intersectionobserver/CMakeLists.txt | 28 +++++++++++++++++++ .../NativeIntersectionObserver.cpp | 2 ++ 2 files changed, 30 insertions(+) create mode 100644 packages/react-native/ReactCommon/react/nativemodule/intersectionobserver/CMakeLists.txt diff --git a/packages/react-native/ReactCommon/react/nativemodule/intersectionobserver/CMakeLists.txt b/packages/react-native/ReactCommon/react/nativemodule/intersectionobserver/CMakeLists.txt new file mode 100644 index 00000000000000..d67c4abf2bd47e --- /dev/null +++ b/packages/react-native/ReactCommon/react/nativemodule/intersectionobserver/CMakeLists.txt @@ -0,0 +1,28 @@ +# 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. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +include(${REACT_COMMON_DIR}/cmake-utils/react-native-flags.cmake) + +file(GLOB react_nativemodule_webperformance_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_nativemodule_intersectionobserver OBJECT ${react_nativemodule_webperformance_SRC}) + +target_include_directories(react_nativemodule_intersectionobserver PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(react_nativemodule_intersectionobserver + react_codegen_rncore + react_cxxreact + react_renderer_bridging + react_renderer_core + react_renderer_graphics + react_renderer_observers_intersection + react_renderer_runtimescheduler + react_renderer_uimanager + rrc_view +) +target_compile_reactnative_options(react_nativemodule_intersectionobserver PRIVATE) +target_compile_options(react_nativemodule_intersectionobserver PRIVATE -Wpedantic -Wno-deprecated-declarations) diff --git a/packages/react-native/ReactCommon/react/nativemodule/intersectionobserver/NativeIntersectionObserver.cpp b/packages/react-native/ReactCommon/react/nativemodule/intersectionobserver/NativeIntersectionObserver.cpp index 4d25acfea12bd7..6dd065f92278c1 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/intersectionobserver/NativeIntersectionObserver.cpp +++ b/packages/react-native/ReactCommon/react/nativemodule/intersectionobserver/NativeIntersectionObserver.cpp @@ -11,7 +11,9 @@ #include #include +#ifdef RN_DISABLE_OSS_PLUGIN_HEADER #include "Plugins.h" +#endif std::shared_ptr NativeIntersectionObserverModuleProvider( From 0a4a0e29c54da09fcd08e58f5a51beaff68a6eae Mon Sep 17 00:00:00 2001 From: Andrew Datsenko Date: Fri, 20 Jun 2025 12:08:56 -0700 Subject: [PATCH 07/15] Add react_nativemodule_mutationobserver cmake (#52161) Summary: Changelog: [Internal] Add missing lib react_nativemodule_mutationobserver Differential Revision: D77035742 --- .../mutationobserver/CMakeLists.txt | 27 +++++++++++++++++++ .../NativeMutationObserver.cpp | 2 ++ 2 files changed, 29 insertions(+) create mode 100644 packages/react-native/ReactCommon/react/nativemodule/mutationobserver/CMakeLists.txt diff --git a/packages/react-native/ReactCommon/react/nativemodule/mutationobserver/CMakeLists.txt b/packages/react-native/ReactCommon/react/nativemodule/mutationobserver/CMakeLists.txt new file mode 100644 index 00000000000000..65be719c3c5e00 --- /dev/null +++ b/packages/react-native/ReactCommon/react/nativemodule/mutationobserver/CMakeLists.txt @@ -0,0 +1,27 @@ +# 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. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) +​​​ +include(${REACT_COMMON_DIR}/cmake-utils/react-native-flags.cmake) +​​​ +file(GLOB react_nativemodule_webperformance_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_nativemodule_mutationobserver OBJECT ${react_nativemodule_webperformance_SRC}) +​​​ +target_include_directories(react_nativemodule_mutationobserver PUBLIC ${REACT_COMMON_DIR}) +​​​ +target_link_libraries(react_nativemodule_mutationobserver + react_codegen_rncore + react_renderer_bridging + react_renderer_core + react_renderer_uimanager + react_featureflags + react_renderer_observers_mutation + react_cxxreact + rrc_view +) +target_compile_reactnative_options(react_nativemodule_mutationobserver PRIVATE) +target_compile_options(react_nativemodule_mutationobserver PRIVATE -Wpedantic) diff --git a/packages/react-native/ReactCommon/react/nativemodule/mutationobserver/NativeMutationObserver.cpp b/packages/react-native/ReactCommon/react/nativemodule/mutationobserver/NativeMutationObserver.cpp index e701bc3298e65a..389ce43fc532f4 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/mutationobserver/NativeMutationObserver.cpp +++ b/packages/react-native/ReactCommon/react/nativemodule/mutationobserver/NativeMutationObserver.cpp @@ -12,7 +12,9 @@ #include #include +#ifdef RN_DISABLE_OSS_PLUGIN_HEADER #include "Plugins.h" +#endif std::shared_ptr NativeMutationObserverModuleProvider( From 87c396e9dbd81969315ff0e70c8c28748679bf92 Mon Sep 17 00:00:00 2001 From: Andrew Datsenko Date: Fri, 20 Jun 2025 12:08:56 -0700 Subject: [PATCH 08/15] Add react_nativemodule_webperformance cmake (#52162) Summary: Changelog: [Internal] Add cmake library react_nativemodule_webperformance Differential Revision: D77035999 --- .../webperformance/CMakeLists.txt | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 packages/react-native/ReactCommon/react/nativemodule/webperformance/CMakeLists.txt diff --git a/packages/react-native/ReactCommon/react/nativemodule/webperformance/CMakeLists.txt b/packages/react-native/ReactCommon/react/nativemodule/webperformance/CMakeLists.txt new file mode 100644 index 00000000000000..7dbe07461464c2 --- /dev/null +++ b/packages/react-native/ReactCommon/react/nativemodule/webperformance/CMakeLists.txt @@ -0,0 +1,21 @@ +# 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. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +include(${REACT_COMMON_DIR}/cmake-utils/react-native-flags.cmake) + +file(GLOB react_nativemodule_webperformance_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_nativemodule_webperformance OBJECT ${react_nativemodule_webperformance_SRC}) + +target_include_directories(react_nativemodule_webperformance PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(react_nativemodule_webperformance + react_codegen_rncore + react_cxxreact +) +target_compile_reactnative_options(react_nativemodule_webperformance PRIVATE) +target_compile_options(react_nativemodule_webperformance PRIVATE -Wpedantic) From 3bbf0ec09c24e6f050a62070d191ac576dba5b77 Mon Sep 17 00:00:00 2001 From: Andrew Datsenko Date: Fri, 20 Jun 2025 12:08:56 -0700 Subject: [PATCH 09/15] Add react_renderer_observers_intersection cmake (#52163) Summary: Changelog: [Internal] Add cmake library react_renderer_observers_intersection Differential Revision: D77036086 --- .../observers/intersection/CMakeLists.txt | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 packages/react-native/ReactCommon/react/renderer/observers/intersection/CMakeLists.txt diff --git a/packages/react-native/ReactCommon/react/renderer/observers/intersection/CMakeLists.txt b/packages/react-native/ReactCommon/react/renderer/observers/intersection/CMakeLists.txt new file mode 100644 index 00000000000000..96cf0c7c63912c --- /dev/null +++ b/packages/react-native/ReactCommon/react/renderer/observers/intersection/CMakeLists.txt @@ -0,0 +1,28 @@ +# 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. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +include(${REACT_COMMON_DIR}/cmake-utils/react-native-flags.cmake) + +file(GLOB react_nativemodule_webperformance_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_renderer_observers_intersection OBJECT ${react_nativemodule_webperformance_SRC}) + +target_include_directories(react_renderer_observers_intersection PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(react_renderer_observers_intersection + react_cxxreact + react_bridging + react_debug + react_renderer_core + react_renderer_graphics + react_renderer_mounting + react_renderer_runtimescheduler + react_renderer_uimanager + rrc_view +) +target_compile_reactnative_options(react_renderer_observers_intersection PRIVATE) +target_compile_options(react_renderer_observers_intersection PRIVATE -Wpedantic) From 8cded1e7a6966798afc0122038efb0b4d1526973 Mon Sep 17 00:00:00 2001 From: Andrew Datsenko Date: Fri, 20 Jun 2025 12:08:56 -0700 Subject: [PATCH 10/15] Add react_renderer_observers_mutation cmake (#52164) Summary: Changelog: [Internal] Add cmake library react_renderer_observers_mutation Differential Revision: D77036195 --- .../observers/mutation/CMakeLists.txt | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 packages/react-native/ReactCommon/react/renderer/observers/mutation/CMakeLists.txt diff --git a/packages/react-native/ReactCommon/react/renderer/observers/mutation/CMakeLists.txt b/packages/react-native/ReactCommon/react/renderer/observers/mutation/CMakeLists.txt new file mode 100644 index 00000000000000..24feb65c4f57a1 --- /dev/null +++ b/packages/react-native/ReactCommon/react/renderer/observers/mutation/CMakeLists.txt @@ -0,0 +1,24 @@ +# 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. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +include(${REACT_COMMON_DIR}/cmake-utils/react-native-flags.cmake) + +file(GLOB react_nativemodule_webperformance_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_renderer_observers_mutation OBJECT ${react_nativemodule_webperformance_SRC}) + +target_include_directories(react_renderer_observers_mutation PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(react_renderer_observers_mutation + react_cxxreact + react_renderer_core + react_renderer_uimanager + react_renderer_mounting + react_bridging +) +target_compile_reactnative_options(react_renderer_observers_mutation PRIVATE) +target_compile_options(react_renderer_observers_mutation PRIVATE -Wpedantic) From bac66c0b3d8a9ec107f996c4a7a7c2f875ed3366 Mon Sep 17 00:00:00 2001 From: Andrew Datsenko Date: Fri, 20 Jun 2025 12:08:56 -0700 Subject: [PATCH 11/15] Add react_cxx_platform_react_coremodules cmake (#52165) Summary: Changelog: [Internal] Add cmake lib react_cxx_platform_react_coremodules Differential Revision: D77036283 --- .../react/coremodules/CMakeLists.txt | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 packages/react-native/ReactCxxPlatform/react/coremodules/CMakeLists.txt diff --git a/packages/react-native/ReactCxxPlatform/react/coremodules/CMakeLists.txt b/packages/react-native/ReactCxxPlatform/react/coremodules/CMakeLists.txt new file mode 100644 index 00000000000000..25132961953b94 --- /dev/null +++ b/packages/react-native/ReactCxxPlatform/react/coremodules/CMakeLists.txt @@ -0,0 +1,23 @@ +# 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. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) +​​​ +include(${REACT_COMMON_DIR}/cmake-utils/react-native-flags.cmake) +​​​ +file(GLOB react_cxx_platform_react_coremodules_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_cxx_platform_react_coremodules OBJECT ${react_cxx_platform_react_coremodules_SRC}) +​​​ +target_include_directories(react_cxx_platform_react_coremodules PUBLIC ${REACT_CXX_PLATFORM_DIR}) +​​​ +target_link_libraries(react_cxx_platform_react_coremodules + folly_runtime + jsi + react_nativemodule_core + react_codegen_rncore +) +target_compile_reactnative_options(react_cxx_platform_react_coremodules PRIVATE) +target_compile_options(react_cxx_platform_react_coremodules PRIVATE -Wpedantic) From aed8b52107e17d9fa41a78b825d3ecfbe1bea3d8 Mon Sep 17 00:00:00 2001 From: Andrew Datsenko Date: Fri, 20 Jun 2025 12:08:56 -0700 Subject: [PATCH 12/15] Add react_cxx_platform_react_devsupport cmake (#52166) Summary: Changelog: [Internal] Add cmake lib react_cxx_platform_react_devsupport Differential Revision: D77037372 --- .../react/devsupport/CMakeLists.txt | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 packages/react-native/ReactCxxPlatform/react/devsupport/CMakeLists.txt diff --git a/packages/react-native/ReactCxxPlatform/react/devsupport/CMakeLists.txt b/packages/react-native/ReactCxxPlatform/react/devsupport/CMakeLists.txt new file mode 100644 index 00000000000000..fc695df675fe01 --- /dev/null +++ b/packages/react-native/ReactCxxPlatform/react/devsupport/CMakeLists.txt @@ -0,0 +1,35 @@ +# 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. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +include(${REACT_COMMON_DIR}/cmake-utils/react-native-flags.cmake) + +file(GLOB react_cxx_platform_react_devsupport_SRC CONFIGURE_DEPENDS + *.cpp + inspector/*.cpp) +add_library(react_cxx_platform_react_devsupport OBJECT ${react_cxx_platform_react_devsupport_SRC}) + +target_include_directories(react_cxx_platform_react_devsupport PUBLIC ${REACT_CXX_PLATFORM_DIR}) + +target_link_libraries(react_cxx_platform_react_devsupport + glog + nlohmann_json + folly_runtime + jsi + OpenSSL::Crypto + react_cxx_platform_react_http + react_cxx_platform_react_nativemodule + react_cxx_platform_react_renderer_scheduler + react_cxx_platform_react_renderer_scheduler + react_cxx_platform_react_threading + react_codegen_rncore + jsinspector + react_debug + react_renderer_graphics +) +target_compile_reactnative_options(react_cxx_platform_react_devsupport PRIVATE) +target_compile_options(react_cxx_platform_react_devsupport PRIVATE -Wpedantic -Wno-deprecated-declarations) From 8526de2524e9359f82f662344bb168bcefdc72a5 Mon Sep 17 00:00:00 2001 From: Andrew Datsenko Date: Fri, 20 Jun 2025 12:08:56 -0700 Subject: [PATCH 13/15] Add react_cxx_platform_react_http cmake (#52167) Summary: Changelog: [Internal] Add cmake lib react_cxx_platform_react_http Differential Revision: D77037486 --- .../react/http/CMakeLists.txt | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 packages/react-native/ReactCxxPlatform/react/http/CMakeLists.txt diff --git a/packages/react-native/ReactCxxPlatform/react/http/CMakeLists.txt b/packages/react-native/ReactCxxPlatform/react/http/CMakeLists.txt new file mode 100644 index 00000000000000..e25095d9f555f4 --- /dev/null +++ b/packages/react-native/ReactCxxPlatform/react/http/CMakeLists.txt @@ -0,0 +1,20 @@ +# 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. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +include(${REACT_COMMON_DIR}/cmake-utils/react-native-flags.cmake) + +file(GLOB react_cxx_platform_react_http_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_cxx_platform_react_http OBJECT ${react_cxx_platform_react_http_SRC}) + +target_include_directories(react_cxx_platform_react_http PUBLIC ${REACT_CXX_PLATFORM_DIR}) + +target_link_libraries(react_cxx_platform_react_http + folly_runtime +) +target_compile_reactnative_options(react_cxx_platform_react_http PRIVATE) +target_compile_options(react_cxx_platform_react_http PRIVATE -Wpedantic) From 50a7aa07450fe8f7492ec5c559d95a70a5ad257c Mon Sep 17 00:00:00 2001 From: Andrew Datsenko Date: Fri, 20 Jun 2025 12:08:56 -0700 Subject: [PATCH 14/15] Add react_cxx_platform_react_io cmake Summary: Changelog: [Internal] Add cmake lib react_cxx_platform_react_io Differential Revision: D77037593 --- .../ReactCxxPlatform/react/io/CMakeLists.txt | 26 +++++++++++++++++++ .../react/io/platform/cxx/ResourceLoader.cpp | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 packages/react-native/ReactCxxPlatform/react/io/CMakeLists.txt diff --git a/packages/react-native/ReactCxxPlatform/react/io/CMakeLists.txt b/packages/react-native/ReactCxxPlatform/react/io/CMakeLists.txt new file mode 100644 index 00000000000000..42c589f05ce93e --- /dev/null +++ b/packages/react-native/ReactCxxPlatform/react/io/CMakeLists.txt @@ -0,0 +1,26 @@ +# 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. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +include(${REACT_COMMON_DIR}/cmake-utils/react-native-flags.cmake) + +file(GLOB react_cxx_platform_react_io_SRC CONFIGURE_DEPENDS *.cpp platform/cxx/*.cpp) +add_library(react_cxx_platform_react_io OBJECT ${react_cxx_platform_react_io_SRC}) + +target_include_directories(react_cxx_platform_react_io PUBLIC ${REACT_CXX_PLATFORM_DIR}) + +target_link_libraries(react_cxx_platform_react_io + glog + jsi + react_cxx_platform_react_nativemodule + react_cxx_platform_react_http + react_cxx_platform_react_threading + react_codegen_rncore + react_bridging +) +target_compile_reactnative_options(react_cxx_platform_react_io PRIVATE) +target_compile_options(react_cxx_platform_react_io PRIVATE -Wpedantic) diff --git a/packages/react-native/ReactCxxPlatform/react/io/platform/cxx/ResourceLoader.cpp b/packages/react-native/ReactCxxPlatform/react/io/platform/cxx/ResourceLoader.cpp index 6d74f5bbb5a53f..8cd2d27c22817d 100644 --- a/packages/react-native/ReactCxxPlatform/react/io/platform/cxx/ResourceLoader.cpp +++ b/packages/react-native/ReactCxxPlatform/react/io/platform/cxx/ResourceLoader.cpp @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. */ -#include "ResourceLoader.h" +#include #include #include From de553349828b0e7936869cf11e5c370fa5c3f3f4 Mon Sep 17 00:00:00 2001 From: Andrew Datsenko Date: Fri, 20 Jun 2025 12:08:56 -0700 Subject: [PATCH 15/15] Add react_cxx_platform_react_logging cmake Summary: Changelog: [Internal] Add cmake lib react_cxx_platform_react_logging Differential Revision: D77037715 --- .../react/logging/CMakeLists.txt | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 packages/react-native/ReactCxxPlatform/react/logging/CMakeLists.txt diff --git a/packages/react-native/ReactCxxPlatform/react/logging/CMakeLists.txt b/packages/react-native/ReactCxxPlatform/react/logging/CMakeLists.txt new file mode 100644 index 00000000000000..3aa3e63bf5db6d --- /dev/null +++ b/packages/react-native/ReactCxxPlatform/react/logging/CMakeLists.txt @@ -0,0 +1,24 @@ +# 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. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +include(${REACT_COMMON_DIR}/cmake-utils/react-native-flags.cmake) + +file(GLOB react_cxx_platform_react_logging_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_cxx_platform_react_logging OBJECT ${react_cxx_platform_react_logging_SRC}) + +target_include_directories(react_cxx_platform_react_logging PUBLIC ${REACT_CXX_PLATFORM_DIR}) + +target_link_libraries(react_cxx_platform_react_logging + glog + react_codegen_rncore + jserrorhandler + react_bridging + logger +) +target_compile_reactnative_options(react_cxx_platform_react_logging PRIVATE) +target_compile_options(react_cxx_platform_react_logging PRIVATE -Wpedantic)