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() - 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/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) 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 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 { 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( 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( 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( 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) 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) 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)