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