From b676ca560d8af686276ac4b88e4feb9c5b7e468d Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Fri, 11 Mar 2022 11:39:23 -0800 Subject: [PATCH] First Round of CMake files for React Android Summary: This is the first round of CMake files to support the React Native build on Android. They're supposed to eventually replace the various Android.mk files we have around in the codebase. So far we're not actively using them. This is the first step towards migrating our setup to use CMake Changelog: [Internal] [Changed] - First Round of CMake files for React Android Reviewed By: ShikaSD Differential Revision: D34762524 fbshipit-source-id: 6671e203a2c83b8874cefe796aa55aa987902a3b --- .../react/common/mapbuffer/jni/CMakeLists.txt | 37 ++++++ .../facebook/react/jscexecutor/CMakeLists.txt | 22 +++ .../react/modules/blob/jni/CMakeLists.txt | 23 ++++ .../react/reactperflogger/jni/CMakeLists.txt | 24 ++++ .../react/turbomodule/core/jni/CMakeLists.txt | 62 +++++++++ .../react/uimanager/jni/CMakeLists.txt | 28 ++++ .../main/jni/first-party/fb/CMakeLists.txt | 28 ++++ .../jni/first-party/fbgloginit/CMakeLists.txt | 15 +++ .../main/jni/first-party/fbjni/CMakeLists.txt | 15 +++ .../jni/first-party/hermes/CMakeLists.txt | 13 ++ .../jni/first-party/yogajni/CMakeLists.txt | 20 +++ .../src/main/jni/react/jni/CMakeLists.txt | 72 ++++++++++ .../src/main/jni/third-party/boost/Android.mk | 2 +- .../main/jni/third-party/boost/CMakeLists.txt | 21 +++ .../jump_arm64_aapcs_elf_gas.S | 0 .../make_arm64_aapcs_elf_gas.S | 0 .../ontop_arm64_aapcs_elf_gas.S | 0 .../jump_arm_aapcs_elf_gas.S | 0 .../make_arm_aapcs_elf_gas.S | 0 .../ontop_arm_aapcs_elf_gas.S | 0 .../double-conversion/CMakeLists.txt | 23 ++++ .../main/jni/third-party/fmt/CMakeLists.txt | 13 ++ .../main/jni/third-party/folly/CMakeLists.txt | 125 ++++++++++++++++++ .../main/jni/third-party/glog/CMakeLists.txt | 35 +++++ .../main/jni/third-party/jsc/CMakeLists.txt | 15 +++ .../jni/third-party/libevent/CMakeLists.txt | 42 ++++++ ReactCommon/butter/CMakeLists.txt | 29 ++++ ReactCommon/callinvoker/CMakeLists.txt | 13 ++ ReactCommon/cxxreact/CMakeLists.txt | 29 ++++ ReactCommon/jsi/CMakeLists.txt | 43 ++++++ ReactCommon/jsiexecutor/CMakeLists.txt | 23 ++++ ReactCommon/jsinspector/CMakeLists.txt | 15 +++ ReactCommon/logger/CMakeLists.txt | 17 +++ ReactCommon/react/config/CMakeLists.txt | 20 +++ ReactCommon/react/debug/CMakeLists.txt | 22 +++ .../react/nativemodule/core/CMakeLists.txt | 33 +++++ .../react/renderer/animations/CMakeLists.txt | 38 ++++++ .../renderer/attributedstring/CMakeLists.txt | 36 +++++ .../renderer/componentregistry/CMakeLists.txt | 30 +++++ .../componentregistry/native/CMakeLists.txt | 28 ++++ .../renderer/components/image/CMakeLists.txt | 35 +++++ .../renderer/components/root/CMakeLists.txt | 28 ++++ .../components/scrollview/CMakeLists.txt | 35 +++++ .../renderer/components/text/CMakeLists.txt | 45 +++++++ .../components/textinput/CMakeLists.txt | 47 +++++++ .../unimplementedview/CMakeLists.txt | 33 +++++ .../renderer/components/view/CMakeLists.txt | 28 ++++ .../react/renderer/core/CMakeLists.txt | 24 ++++ .../react/renderer/debug/CMakeLists.txt | 17 +++ .../react/renderer/graphics/CMakeLists.txt | 23 ++++ .../renderer/imagemanager/CMakeLists.txt | 34 +++++ .../react/renderer/leakchecker/CMakeLists.txt | 20 +++ .../react/renderer/mapbuffer/CMakeLists.txt | 17 +++ .../react/renderer/mounting/CMakeLists.txt | 33 +++++ .../renderer/runtimescheduler/CMakeLists.txt | 26 ++++ .../react/renderer/scheduler/CMakeLists.txt | 43 ++++++ .../react/renderer/telemetry/CMakeLists.txt | 30 +++++ .../renderer/templateprocessor/CMakeLists.txt | 28 ++++ .../renderer/textlayoutmanager/CMakeLists.txt | 44 ++++++ .../react/renderer/uimanager/CMakeLists.txt | 37 ++++++ ReactCommon/react/utils/CMakeLists.txt | 27 ++++ ReactCommon/reactperflogger/CMakeLists.txt | 15 +++ ReactCommon/runtimeexecutor/CMakeLists.txt | 13 ++ ReactCommon/yoga/CMakeLists.txt | 16 +++ 64 files changed, 1708 insertions(+), 1 deletion(-) create mode 100644 ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/CMakeLists.txt create mode 100644 ReactAndroid/src/main/java/com/facebook/react/jscexecutor/CMakeLists.txt create mode 100644 ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/CMakeLists.txt create mode 100644 ReactAndroid/src/main/java/com/facebook/react/reactperflogger/jni/CMakeLists.txt create mode 100644 ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/CMakeLists.txt create mode 100644 ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/CMakeLists.txt create mode 100644 ReactAndroid/src/main/jni/first-party/fb/CMakeLists.txt create mode 100644 ReactAndroid/src/main/jni/first-party/fbgloginit/CMakeLists.txt create mode 100644 ReactAndroid/src/main/jni/first-party/fbjni/CMakeLists.txt create mode 100644 ReactAndroid/src/main/jni/first-party/hermes/CMakeLists.txt create mode 100644 ReactAndroid/src/main/jni/first-party/yogajni/CMakeLists.txt create mode 100644 ReactAndroid/src/main/jni/react/jni/CMakeLists.txt create mode 100644 ReactAndroid/src/main/jni/third-party/boost/CMakeLists.txt rename ReactAndroid/src/main/jni/third-party/boost/asm/{arm64 => arm64-v8a}/jump_arm64_aapcs_elf_gas.S (100%) rename ReactAndroid/src/main/jni/third-party/boost/asm/{arm64 => arm64-v8a}/make_arm64_aapcs_elf_gas.S (100%) rename ReactAndroid/src/main/jni/third-party/boost/asm/{arm64 => arm64-v8a}/ontop_arm64_aapcs_elf_gas.S (100%) rename ReactAndroid/src/main/jni/third-party/boost/asm/{arm => armeabi-v7a}/jump_arm_aapcs_elf_gas.S (100%) rename ReactAndroid/src/main/jni/third-party/boost/asm/{arm => armeabi-v7a}/make_arm_aapcs_elf_gas.S (100%) rename ReactAndroid/src/main/jni/third-party/boost/asm/{arm => armeabi-v7a}/ontop_arm_aapcs_elf_gas.S (100%) create mode 100644 ReactAndroid/src/main/jni/third-party/double-conversion/CMakeLists.txt create mode 100644 ReactAndroid/src/main/jni/third-party/fmt/CMakeLists.txt create mode 100644 ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt create mode 100644 ReactAndroid/src/main/jni/third-party/glog/CMakeLists.txt create mode 100644 ReactAndroid/src/main/jni/third-party/jsc/CMakeLists.txt create mode 100644 ReactAndroid/src/main/jni/third-party/libevent/CMakeLists.txt create mode 100644 ReactCommon/butter/CMakeLists.txt create mode 100644 ReactCommon/callinvoker/CMakeLists.txt create mode 100644 ReactCommon/cxxreact/CMakeLists.txt create mode 100644 ReactCommon/jsi/CMakeLists.txt create mode 100644 ReactCommon/jsiexecutor/CMakeLists.txt create mode 100644 ReactCommon/jsinspector/CMakeLists.txt create mode 100644 ReactCommon/logger/CMakeLists.txt create mode 100644 ReactCommon/react/config/CMakeLists.txt create mode 100644 ReactCommon/react/debug/CMakeLists.txt create mode 100644 ReactCommon/react/nativemodule/core/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/animations/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/attributedstring/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/componentregistry/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/componentregistry/native/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/components/image/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/components/root/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/components/scrollview/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/components/text/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/components/textinput/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/components/unimplementedview/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/components/view/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/core/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/debug/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/graphics/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/imagemanager/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/leakchecker/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/mapbuffer/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/mounting/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/runtimescheduler/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/scheduler/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/telemetry/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/templateprocessor/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/textlayoutmanager/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/uimanager/CMakeLists.txt create mode 100644 ReactCommon/react/utils/CMakeLists.txt create mode 100644 ReactCommon/reactperflogger/CMakeLists.txt create mode 100644 ReactCommon/runtimeexecutor/CMakeLists.txt create mode 100644 ReactCommon/yoga/CMakeLists.txt diff --git a/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/CMakeLists.txt b/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/CMakeLists.txt new file mode 100644 index 00000000000..3f520baf756 --- /dev/null +++ b/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/CMakeLists.txt @@ -0,0 +1,37 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library( + mapbufferjni + SHARED + react/common/mapbuffer/OnLoad.cpp + react/common/mapbuffer/ReadableMapBuffer.cpp +) + +target_include_directories(mapbufferjni + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/react/common/mapbuffer/ +) + +target_link_libraries(mapbufferjni + fb + fbjni + folly_futures + folly_json + glog + glog_init + react_debug + react_render_mapbuffer + react_utils + react_config + yoga +) diff --git a/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/CMakeLists.txt b/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/CMakeLists.txt new file mode 100644 index 00000000000..9be5cfcac90 --- /dev/null +++ b/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/CMakeLists.txt @@ -0,0 +1,22 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fvisibility=hidden -fexceptions -frtti) + +add_library(jscexecutor SHARED OnLoad.cpp) + +target_include_directories(jscexecutor PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + +target_link_libraries(jscexecutor + jsireact + jscruntime + fb + fbjni + folly_json + jsi + reactnativejni) diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/CMakeLists.txt b/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/CMakeLists.txt new file mode 100644 index 00000000000..fb936befd7b --- /dev/null +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fvisibility=hidden -fexceptions -frtti) + +add_library(reactnativeblob SHARED + BlobCollector.cpp + OnLoad.cpp) + +target_include_directories(reactnativeblob PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + +target_link_libraries(reactnativeblob + jsireact + fb + fbjni + folly_json + jsi + reactnativejni) diff --git a/ReactAndroid/src/main/java/com/facebook/react/reactperflogger/jni/CMakeLists.txt b/ReactAndroid/src/main/java/com/facebook/react/reactperflogger/jni/CMakeLists.txt new file mode 100644 index 00000000000..77cf0453b29 --- /dev/null +++ b/ReactAndroid/src/main/java/com/facebook/react/reactperflogger/jni/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall) + +add_library(reactperfloggerjni SHARED reactperflogger/OnLoad.cpp) + +target_include_directories(reactperfloggerjni + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/reactperflogger +) + +target_link_libraries(reactperfloggerjni + fb + fbjni + android + reactperflogger) diff --git a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/CMakeLists.txt b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/CMakeLists.txt new file mode 100644 index 00000000000..e2658fa613f --- /dev/null +++ b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/CMakeLists.txt @@ -0,0 +1,62 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options( + -fexceptions + -frtti + -Wno-unused-lambda-capture + -std=c++17) + +######################### +### callinvokerholder ### +######################### + +# TODO This should be exported to its own folder hierarchy +add_library( + callinvokerholder + STATIC + ReactCommon/CallInvokerHolder.cpp +) + +target_include_directories(callinvokerholder + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} + ) + +target_link_libraries(callinvokerholder + fb + fbjni + runtimeexecutor + callinvoker + reactperfloggerjni) + +################################## +### react_nativemodule_manager ### +################################## + +# TODO: rename to react_nativemodule_manager +add_library( + turbomodulejsijni + SHARED + ReactCommon/TurboModuleManager.cpp + ReactCommon/OnLoad.cpp +) + +target_include_directories( + turbomodulejsijni + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_link_libraries(turbomodulejsijni + fb + fbjni + jsi + react_nativemodule_core + callinvokerholder + reactperfloggerjni) diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/CMakeLists.txt b/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/CMakeLists.txt new file mode 100644 index 00000000000..33572211ba2 --- /dev/null +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"ReactNative\") + +add_library(uimanagerjni SHARED + OnLoad.cpp + ComponentNameResolverManager.cpp) + +target_include_directories(uimanagerjni PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +target_link_libraries(uimanagerjni + fb + fbjni + folly_futures + folly_json + glog + glog_init + rrc_native + yoga + callinvokerholder + reactnativejni + react_render_componentregistry) diff --git a/ReactAndroid/src/main/jni/first-party/fb/CMakeLists.txt b/ReactAndroid/src/main/jni/first-party/fb/CMakeLists.txt new file mode 100644 index 00000000000..7536286d348 --- /dev/null +++ b/ReactAndroid/src/main/jni/first-party/fb/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_library(fb + SHARED + assert.cpp + log.cpp) + +add_compile_options( + -DLOG_TAG=\"libfb\" + -DDISABLE_CPUCAP + -DDISABLE_XPLAT + -fexceptions + -frtti + -Wno-unused-parameter + -Wno-error=unused-but-set-variable + -DHAVE_POSIX_CLOCKS +) + +# Yogacore needs to link towards android and log from the NDK libs +target_link_libraries(fb dl android log) + +target_include_directories(fb PUBLIC include) diff --git a/ReactAndroid/src/main/jni/first-party/fbgloginit/CMakeLists.txt b/ReactAndroid/src/main/jni/first-party/fbgloginit/CMakeLists.txt new file mode 100644 index 00000000000..02fb3540f85 --- /dev/null +++ b/ReactAndroid/src/main/jni/first-party/fbgloginit/CMakeLists.txt @@ -0,0 +1,15 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -fno-omit-frame-pointer) + +add_library(glog_init SHARED glog_init.cpp) + +target_include_directories(yoga PUBLIC .) + +target_link_libraries(glog_init log glog) diff --git a/ReactAndroid/src/main/jni/first-party/fbjni/CMakeLists.txt b/ReactAndroid/src/main/jni/first-party/fbjni/CMakeLists.txt new file mode 100644 index 00000000000..dd1ced88a49 --- /dev/null +++ b/ReactAndroid/src/main/jni/first-party/fbjni/CMakeLists.txt @@ -0,0 +1,15 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_library(fbjni SHARED IMPORTED GLOBAL) +set_target_properties(fbjni + PROPERTIES + IMPORTED_LOCATION + ${CMAKE_CURRENT_SOURCE_DIR}/jni/${ANDROID_ABI}/libfbjni.so) + +target_include_directories(fbjni INTERFACE headers) diff --git a/ReactAndroid/src/main/jni/first-party/hermes/CMakeLists.txt b/ReactAndroid/src/main/jni/first-party/hermes/CMakeLists.txt new file mode 100644 index 00000000000..db6da1e5067 --- /dev/null +++ b/ReactAndroid/src/main/jni/first-party/hermes/CMakeLists.txt @@ -0,0 +1,13 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_library(hermes SHARED IMPORTED GLOBAL) +set_target_properties(hermes + PROPERTIES + IMPORTED_LOCATION + ${CMAKE_CURRENT_SOURCE_DIR}/jni/${ANDROID_ABI}/libhermes.so) diff --git a/ReactAndroid/src/main/jni/first-party/yogajni/CMakeLists.txt b/ReactAndroid/src/main/jni/first-party/yogajni/CMakeLists.txt new file mode 100644 index 00000000000..8d6dce75ce0 --- /dev/null +++ b/ReactAndroid/src/main/jni/first-party/yogajni/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options( + -fvisibility=hidden + -fexceptions + -frtti + -O3) + +file(GLOB_RECURSE yoga_SRC jni/*.cpp) +add_library(yoga SHARED ${yoga_SRC}) + +target_include_directories(yoga PUBLIC jni) + +target_link_libraries(yoga yogacore fb fbjni log android) diff --git a/ReactAndroid/src/main/jni/react/jni/CMakeLists.txt b/ReactAndroid/src/main/jni/react/jni/CMakeLists.txt new file mode 100644 index 00000000000..4182cb4d5e0 --- /dev/null +++ b/ReactAndroid/src/main/jni/react/jni/CMakeLists.txt @@ -0,0 +1,72 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +# TODO Those two libraries are building against the same sources +# and should probably be merged +file(GLOB reactnativejni_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) + +add_compile_options( + -fexceptions + -frtti + -Wno-unused-lambda-capture + -std=c++17) + +########################## +### React Native Utils ### +########################## + +add_library( + reactnativeutilsjni + SHARED + ${reactnativejni_SRC} +) + +# TODO This should not be ../../ +target_include_directories(reactnativeutilsjni PUBLIC ../../) + +target_link_libraries(reactnativeutilsjni + android + callinvokerholder + fb + fbjni + folly_json + glog_init + react_render_runtimescheduler + reactnative + runtimeexecutor + yoga + ) + +###################### +### reactnativejni ### +###################### + + +add_library( + reactnativejni + SHARED + ${reactnativejni_SRC} +) + +# TODO This should not be ../../ +target_include_directories(reactnativejni PUBLIC ../../) + +target_link_libraries(reactnativejni + android + callinvokerholder + fb + fbjni + folly_json + glog_init + logger + react_render_runtimescheduler + reactnative + reactnativeutilsjni + runtimeexecutor + yoga + ) diff --git a/ReactAndroid/src/main/jni/third-party/boost/Android.mk b/ReactAndroid/src/main/jni/third-party/boost/Android.mk index 6092d28c5d9..7e888b7bb84 100644 --- a/ReactAndroid/src/main/jni/third-party/boost/Android.mk +++ b/ReactAndroid/src/main/jni/third-party/boost/Android.mk @@ -4,7 +4,7 @@ include $(CLEAR_VARS) # These ASM files are picked from the boost release separately, # because the react native version does not include anything outside of headers. # They are required for Folly futures to compile successfully. -LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/asm/$(TARGET_ARCH)/*.S) +LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/asm/$(TARGET_ARCH_ABI)/*.S) LOCAL_C_INCLUDES := $(LOCAL_PATH)/boost_1_63_0 LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/boost_1_63_0 diff --git a/ReactAndroid/src/main/jni/third-party/boost/CMakeLists.txt b/ReactAndroid/src/main/jni/third-party/boost/CMakeLists.txt new file mode 100644 index 00000000000..b7c8779161c --- /dev/null +++ b/ReactAndroid/src/main/jni/third-party/boost/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +# These ASM files are picked from the boost release separately, +# because the react native version does not include anything outside of headers. +# They are required for Folly futures to compile successfully. +ENABLE_LANGUAGE(ASM) +file(GLOB_RECURSE + boostasm_SRC + ${CMAKE_CURRENT_SOURCE_DIR}/asm/${ANDROID_ABI}/*.S) +add_library(boost STATIC ${boostasm_SRC}) + +set_target_properties(boost PROPERTIES LINKER_LANGUAGE CXX) + +target_include_directories(boost PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/boost_1_63_0) + diff --git a/ReactAndroid/src/main/jni/third-party/boost/asm/arm64/jump_arm64_aapcs_elf_gas.S b/ReactAndroid/src/main/jni/third-party/boost/asm/arm64-v8a/jump_arm64_aapcs_elf_gas.S similarity index 100% rename from ReactAndroid/src/main/jni/third-party/boost/asm/arm64/jump_arm64_aapcs_elf_gas.S rename to ReactAndroid/src/main/jni/third-party/boost/asm/arm64-v8a/jump_arm64_aapcs_elf_gas.S diff --git a/ReactAndroid/src/main/jni/third-party/boost/asm/arm64/make_arm64_aapcs_elf_gas.S b/ReactAndroid/src/main/jni/third-party/boost/asm/arm64-v8a/make_arm64_aapcs_elf_gas.S similarity index 100% rename from ReactAndroid/src/main/jni/third-party/boost/asm/arm64/make_arm64_aapcs_elf_gas.S rename to ReactAndroid/src/main/jni/third-party/boost/asm/arm64-v8a/make_arm64_aapcs_elf_gas.S diff --git a/ReactAndroid/src/main/jni/third-party/boost/asm/arm64/ontop_arm64_aapcs_elf_gas.S b/ReactAndroid/src/main/jni/third-party/boost/asm/arm64-v8a/ontop_arm64_aapcs_elf_gas.S similarity index 100% rename from ReactAndroid/src/main/jni/third-party/boost/asm/arm64/ontop_arm64_aapcs_elf_gas.S rename to ReactAndroid/src/main/jni/third-party/boost/asm/arm64-v8a/ontop_arm64_aapcs_elf_gas.S diff --git a/ReactAndroid/src/main/jni/third-party/boost/asm/arm/jump_arm_aapcs_elf_gas.S b/ReactAndroid/src/main/jni/third-party/boost/asm/armeabi-v7a/jump_arm_aapcs_elf_gas.S similarity index 100% rename from ReactAndroid/src/main/jni/third-party/boost/asm/arm/jump_arm_aapcs_elf_gas.S rename to ReactAndroid/src/main/jni/third-party/boost/asm/armeabi-v7a/jump_arm_aapcs_elf_gas.S diff --git a/ReactAndroid/src/main/jni/third-party/boost/asm/arm/make_arm_aapcs_elf_gas.S b/ReactAndroid/src/main/jni/third-party/boost/asm/armeabi-v7a/make_arm_aapcs_elf_gas.S similarity index 100% rename from ReactAndroid/src/main/jni/third-party/boost/asm/arm/make_arm_aapcs_elf_gas.S rename to ReactAndroid/src/main/jni/third-party/boost/asm/armeabi-v7a/make_arm_aapcs_elf_gas.S diff --git a/ReactAndroid/src/main/jni/third-party/boost/asm/arm/ontop_arm_aapcs_elf_gas.S b/ReactAndroid/src/main/jni/third-party/boost/asm/armeabi-v7a/ontop_arm_aapcs_elf_gas.S similarity index 100% rename from ReactAndroid/src/main/jni/third-party/boost/asm/arm/ontop_arm_aapcs_elf_gas.S rename to ReactAndroid/src/main/jni/third-party/boost/asm/armeabi-v7a/ontop_arm_aapcs_elf_gas.S diff --git a/ReactAndroid/src/main/jni/third-party/double-conversion/CMakeLists.txt b/ReactAndroid/src/main/jni/third-party/double-conversion/CMakeLists.txt new file mode 100644 index 00000000000..bc279fbe874 --- /dev/null +++ b/ReactAndroid/src/main/jni/third-party/double-conversion/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-Wno-unused-variable -Wno-unused-local-typedefs) + +add_library(double-conversion + STATIC + double-conversion/bignum.cc + double-conversion/bignum-dtoa.cc + double-conversion/cached-powers.cc + double-conversion/diy-fp.cc + double-conversion/double-conversion.cc + double-conversion/fast-dtoa.cc + double-conversion/fixed-dtoa.cc + double-conversion/strtod.cc) + +target_include_directories(double-conversion PUBLIC .) + diff --git a/ReactAndroid/src/main/jni/third-party/fmt/CMakeLists.txt b/ReactAndroid/src/main/jni/third-party/fmt/CMakeLists.txt new file mode 100644 index 00000000000..1791e7dc833 --- /dev/null +++ b/ReactAndroid/src/main/jni/third-party/fmt/CMakeLists.txt @@ -0,0 +1,13 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-std=c++11 -fexceptions) + +add_library(fmt STATIC src/format.cc) + +target_include_directories(fmt PUBLIC include) diff --git a/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt b/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt new file mode 100644 index 00000000000..5048c7ef4ca --- /dev/null +++ b/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt @@ -0,0 +1,125 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +SET(folly_FLAGS + -DFOLLY_NO_CONFIG=1 + -DFOLLY_HAVE_CLOCK_GETTIME=1 + -DFOLLY_USE_LIBCPP=1 + -DFOLLY_MOBILE=1 + -DFOLLY_HAVE_RECVMMSG=1 + -DFOLLY_HAVE_PTHREAD=1 + # If APP_PLATFORM in Application.mk targets android-23 above, please comment + # the following line. NDK uses GNU style stderror_r() after API 23. + -DFOLLY_HAVE_XSI_STRERROR_R=1 + ) + +################## +### folly_json ### +################## + +SET(folly_json_SRC + folly/json.cpp + folly/Unicode.cpp + folly/Conv.cpp + folly/Demangle.cpp + folly/memory/detail/MallocImpl.cpp + folly/String.cpp + folly/dynamic.cpp + folly/FileUtil.cpp + folly/Format.cpp + folly/net/NetOps.cpp + folly/json_pointer.cpp + folly/lang/CString.cpp + folly/lang/SafeAssert.cpp + folly/detail/UniqueInstance.cpp + folly/hash/SpookyHashV2.cpp + folly/container/detail/F14Table.cpp + folly/ScopeGuard.cpp + folly/portability/SysUio.cpp + folly/lang/ToAscii.cpp) + +IF (CMAKE_BUILD_TYPE MATCHES Debug) + list(APPEND folly_json_SRC folly/lang/Assume.cpp) +ENDIF () + +add_library(folly_json SHARED ${folly_json_SRC}) + +target_compile_options(folly_json + PRIVATE + -fexceptions + -fno-omit-frame-pointer + -frtti + -Wno-sign-compare + ${folly_FLAGS}) + +target_compile_options(folly_json PUBLIC ${folly_FLAGS}) + +target_include_directories(folly_json PUBLIC .) +target_link_libraries(folly_json glog double-conversion boost fmt) + +##################### +### folly_futures ### +##################### + +add_library(folly_futures SHARED + folly/ExceptionWrapper.cpp + folly/ExceptionString.cpp + folly/Executor.cpp + folly/SharedMutex.cpp + folly/Singleton.cpp + folly/Try.cpp + folly/concurrency/CacheLocality.cpp + folly/detail/AsyncTrace.cpp + folly/detail/AtFork.cpp + folly/detail/Futex.cpp + folly/detail/MemoryIdler.cpp + folly/detail/SingletonStackTrace.cpp + folly/detail/StaticSingletonManager.cpp + folly/detail/ThreadLocalDetail.cpp + folly/fibers/Baton.cpp + folly/fibers/FiberManager.cpp + folly/fibers/Fiber.cpp + folly/fibers/GuardPageAllocator.cpp + folly/futures/detail/Core.cpp + folly/futures/Future.cpp + folly/futures/ThreadWheelTimekeeper.cpp + folly/executors/ExecutorWithPriority.cpp + folly/executors/InlineExecutor.cpp + folly/executors/TimedDrivableExecutor.cpp + folly/executors/QueuedImmediateExecutor.cpp + folly/io/async/AsyncTimeout.cpp + folly/io/async/EventBase.cpp + folly/io/async/EventBaseBackendBase.cpp + folly/io/async/EventBaseLocal.cpp + folly/io/async/EventHandler.cpp + folly/io/async/HHWheelTimer.cpp + folly/io/async/Request.cpp + folly/io/async/TimeoutManager.cpp + folly/io/async/VirtualEventBase.cpp + folly/lang/Exception.cpp + folly/memory/MallctlHelper.cpp + folly/portability/SysMembarrier.cpp + folly/synchronization/AsymmetricMemoryBarrier.cpp + folly/synchronization/Hazptr.cpp + folly/synchronization/ParkingLot.cpp + folly/synchronization/WaitOptions.cpp + folly/synchronization/detail/Sleeper.cpp + folly/system/Pid.cpp + folly/system/ThreadId.cpp + folly/system/ThreadName.cpp) + +target_compile_options(folly_futures + PRIVATE + -fexceptions + -fno-omit-frame-pointer + -frtti + -Wno-sign-compare + -Wno-unused-variable) + +target_include_directories(folly_futures PUBLIC .) +target_link_libraries(folly_futures glog double-conversion folly_json boost event fmt) diff --git a/ReactAndroid/src/main/jni/third-party/glog/CMakeLists.txt b/ReactAndroid/src/main/jni/third-party/glog/CMakeLists.txt new file mode 100644 index 00000000000..66a4a426520 --- /dev/null +++ b/ReactAndroid/src/main/jni/third-party/glog/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options( + -Wwrite-strings + -Woverloaded-virtual + -Wno-sign-compare + -DNDEBUG + -g + -O2 + -DHAVE_PREAD=1 +) + +add_library(glog + SHARED + glog-0.3.5/src/demangle.cc + glog-0.3.5/src/logging.cc + glog-0.3.5/src/raw_logging.cc + glog-0.3.5/src/signalhandler.cc + glog-0.3.5/src/symbolize.cc + glog-0.3.5/src/utilities.cc + glog-0.3.5/src/vlog_is_on.cc + ) + +# For private compilation, we include all the headers. +# config.h is also there. +target_include_directories(glog PRIVATE .) +# For consumer, we set the `exported` dir as the +# include folder. +target_include_directories(glog PUBLIC exported) diff --git a/ReactAndroid/src/main/jni/third-party/jsc/CMakeLists.txt b/ReactAndroid/src/main/jni/third-party/jsc/CMakeLists.txt new file mode 100644 index 00000000000..93c3d11a507 --- /dev/null +++ b/ReactAndroid/src/main/jni/third-party/jsc/CMakeLists.txt @@ -0,0 +1,15 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_library(jsc SHARED IMPORTED GLOBAL) +set_target_properties(jsc + PROPERTIES + IMPORTED_LOCATION + ${CMAKE_CURRENT_SOURCE_DIR}/jni/${ANDROID_ABI}/libjsc.so) + +target_include_directories(jsc INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/ReactAndroid/src/main/jni/third-party/libevent/CMakeLists.txt b/ReactAndroid/src/main/jni/third-party/libevent/CMakeLists.txt new file mode 100644 index 00000000000..d729f409b34 --- /dev/null +++ b/ReactAndroid/src/main/jni/third-party/libevent/CMakeLists.txt @@ -0,0 +1,42 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options( + -DNDEBUG + -O2 + -Wno-unused-function + -Wno-unneeded-internal-declaration + -std=c11) + +add_library(event + STATIC + event.c + buffer.c + bufferevent.c + bufferevent_filter.c + bufferevent_pair.c + bufferevent_ratelim.c + bufferevent_sock.c + epoll.c + evmap.c + evthread.c + evthread_pthread.c + evutil.c + evutil_rand.c + evutil_time.c + listener.c + log.c + poll.c + signal.c + strlcpy.c + select.c) + +target_include_directories(event PUBLIC include) + +# link against libc as well +target_link_libraries(event c) diff --git a/ReactCommon/butter/CMakeLists.txt b/ReactCommon/butter/CMakeLists.txt new file mode 100644 index 00000000000..4bc2a762941 --- /dev/null +++ b/ReactCommon/butter/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options( + -DLOG_TAG=\"Butter\" + -fexceptions + -frtti + -std=c++17 + -Wall) + +add_library(butter + SHARED + butter.h + map.h + mutex.h + set.h + small_vector.h + ) + +set_target_properties(butter PROPERTIES LINKER_LANGUAGE CXX) + +target_include_directories(butter PUBLIC .) + +target_link_libraries(butter glog) diff --git a/ReactCommon/callinvoker/CMakeLists.txt b/ReactCommon/callinvoker/CMakeLists.txt new file mode 100644 index 00000000000..ab6716c0b2c --- /dev/null +++ b/ReactCommon/callinvoker/CMakeLists.txt @@ -0,0 +1,13 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall) + +add_library(callinvoker INTERFACE) + +target_include_directories(callinvoker INTERFACE .) diff --git a/ReactCommon/cxxreact/CMakeLists.txt b/ReactCommon/cxxreact/CMakeLists.txt new file mode 100644 index 00000000000..bb224989f42 --- /dev/null +++ b/ReactCommon/cxxreact/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options( + -fexceptions + -frtti + -Wno-unused-lambda-capture + -DLOG_TAG=\"ReactNative\") + +file(GLOB reactnative_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +add_library(reactnative STATIC ${reactnative_SRC}) + +target_include_directories(reactnative PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(reactnative + boost + callinvoker + folly_json + glog + jsi + jsinspector + logger + reactperflogger + runtimeexecutor) diff --git a/ReactCommon/jsi/CMakeLists.txt b/ReactCommon/jsi/CMakeLists.txt new file mode 100644 index 00000000000..07901bae401 --- /dev/null +++ b/ReactCommon/jsi/CMakeLists.txt @@ -0,0 +1,43 @@ +# 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. + +################## +### jsi ### +################## + +cmake_minimum_required(VERSION 3.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options( + -fexceptions + -frtti + -O3 + -Wno-unused-lambda-capture + -DLOG_TAG=\"ReactNative\") + +file(GLOB jsi_SRC ${CMAKE_CURRENT_SOURCE_DIR}/jsi/*.cpp) +add_library(jsi SHARED ${jsi_SRC}) + +target_include_directories(jsi PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +target_link_libraries(jsi + folly_json + glog) + +################## +### jscruntime ### +################## + +add_library(jscruntime STATIC + JSCRuntime.h + JSCRuntime.cpp) + +target_include_directories(jscruntime PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +target_link_libraries(jscruntime folly_json jsc glog) + +# TODO: Remove this flag when ready. +# Android has this enabled by default, but the flag is still needed for iOS. +target_compile_options(jscruntime PRIVATE -DRN_FABRIC_ENABLED) diff --git a/ReactCommon/jsiexecutor/CMakeLists.txt b/ReactCommon/jsiexecutor/CMakeLists.txt new file mode 100644 index 00000000000..5964a7e5e9b --- /dev/null +++ b/ReactCommon/jsiexecutor/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -O3) + +add_library(jsireact + STATIC + jsireact/JSIExecutor.cpp + jsireact/JSINativeModules.cpp) + +target_include_directories(jsireact PUBLIC .) + +target_link_libraries(jsireact + reactnative + reactperflogger + folly_json + glog + jsi) diff --git a/ReactCommon/jsinspector/CMakeLists.txt b/ReactCommon/jsinspector/CMakeLists.txt new file mode 100644 index 00000000000..c349ca9fff2 --- /dev/null +++ b/ReactCommon/jsinspector/CMakeLists.txt @@ -0,0 +1,15 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions) + +add_library(jsinspector + SHARED + InspectorInterfaces.cpp) + +target_include_directories(jsinspector PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/logger/CMakeLists.txt b/ReactCommon/logger/CMakeLists.txt new file mode 100644 index 00000000000..aa572387e71 --- /dev/null +++ b/ReactCommon/logger/CMakeLists.txt @@ -0,0 +1,17 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions) + +add_library(logger + SHARED + react_native_log.cpp) + +target_include_directories(logger PUBLIC .) + +target_link_libraries(logger glog) diff --git a/ReactCommon/react/config/CMakeLists.txt b/ReactCommon/react/config/CMakeLists.txt new file mode 100644 index 00000000000..92c9a44b089 --- /dev/null +++ b/ReactCommon/react/config/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options( + -fexceptions + -frtti + -std=c++17 + -Wall + -DLOG_TAG=\"Fabric\") + +add_library(react_config + SHARED + ReactNativeConfig.cpp) + +target_include_directories(react_config PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/react/debug/CMakeLists.txt b/ReactCommon/react/debug/CMakeLists.txt new file mode 100644 index 00000000000..8814f328a9c --- /dev/null +++ b/ReactCommon/react/debug/CMakeLists.txt @@ -0,0 +1,22 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options( + -fexceptions + -frtti + -std=c++17 + -Wall + -DLOG_TAG=\"Fabric\") + +add_library(react_debug + SHARED + react_native_assert.cpp) + +target_include_directories(react_debug PUBLIC ../../..) + +target_link_libraries(react_debug log folly_json) diff --git a/ReactCommon/react/nativemodule/core/CMakeLists.txt b/ReactCommon/react/nativemodule/core/CMakeLists.txt new file mode 100644 index 00000000000..a1930c387ee --- /dev/null +++ b/ReactCommon/react/nativemodule/core/CMakeLists.txt @@ -0,0 +1,33 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"ReactNative\") + +add_library(react_nativemodule_core + SHARED + ReactCommon/LongLivedObject.cpp + ReactCommon/TurboCxxModule.cpp + ReactCommon/TurboModule.cpp + ReactCommon/TurboModuleBinding.cpp + ReactCommon/TurboModulePerfLogger.cpp + ReactCommon/TurboModuleUtils.cpp + platform/android/ReactCommon/JavaTurboModule.cpp) + +target_include_directories(react_nativemodule_core + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/platform/android/ + ) + +target_link_libraries(react_nativemodule_core + fbjni + folly_json + jsi + react_debug + reactperflogger + reactnativejni) diff --git a/ReactCommon/react/renderer/animations/CMakeLists.txt b/ReactCommon/react/renderer/animations/CMakeLists.txt new file mode 100644 index 00000000000..ccb5f6e5e21 --- /dev/null +++ b/ReactCommon/react/renderer/animations/CMakeLists.txt @@ -0,0 +1,38 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library( + react_render_animations + SHARED + LayoutAnimationDriver.cpp + LayoutAnimationKeyFrameManager.cpp + utils.cpp +) + +target_include_directories(react_render_animations PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(react_render_animations + folly_futures + folly_json + glog + glog_init + jsi + react_config + react_debug + react_render_componentregistry + react_render_core + react_render_debug + react_render_graphics + react_render_mounting + react_render_uimanager + rrc_view + runtimeexecutor + yoga +) diff --git a/ReactCommon/react/renderer/attributedstring/CMakeLists.txt b/ReactCommon/react/renderer/attributedstring/CMakeLists.txt new file mode 100644 index 00000000000..4566deac13f --- /dev/null +++ b/ReactCommon/react/renderer/attributedstring/CMakeLists.txt @@ -0,0 +1,36 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library( + react_render_attributedstring + SHARED + AttributedString.cpp + AttributedStringBox.cpp + ParagraphAttributes.cpp + TextAttributes.cpp +) + +target_include_directories(react_render_attributedstring PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(react_render_attributedstring + butter + folly_futures + folly_json + glog + glog_init + react_debug + react_render_core + react_render_debug + react_render_graphics + react_render_mapbuffer + react_utils + rrc_view + yoga +) diff --git a/ReactCommon/react/renderer/componentregistry/CMakeLists.txt b/ReactCommon/react/renderer/componentregistry/CMakeLists.txt new file mode 100644 index 00000000000..b4543e023fa --- /dev/null +++ b/ReactCommon/react/renderer/componentregistry/CMakeLists.txt @@ -0,0 +1,30 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library( + react_render_componentregistry + SHARED + ComponentDescriptorProviderRegistry.cpp + ComponentDescriptorRegistry.cpp + componentNameByReactViewName.cpp +) + +target_include_directories(react_render_componentregistry PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(react_render_componentregistry + folly_futures + folly_json + glog_init + jsi + react_debug + react_render_core + react_render_debug + react_utils +) diff --git a/ReactCommon/react/renderer/componentregistry/native/CMakeLists.txt b/ReactCommon/react/renderer/componentregistry/native/CMakeLists.txt new file mode 100644 index 00000000000..b6139a015c4 --- /dev/null +++ b/ReactCommon/react/renderer/componentregistry/native/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library( + rrc_native + SHARED + NativeComponentRegistryBinding.cpp +) + +target_include_directories(rrc_native PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(rrc_native + folly_futures + folly_json + glog_init + jsi + react_debug + react_render_core + react_render_debug + react_utils +) diff --git a/ReactCommon/react/renderer/components/image/CMakeLists.txt b/ReactCommon/react/renderer/components/image/CMakeLists.txt new file mode 100644 index 00000000000..b750754849f --- /dev/null +++ b/ReactCommon/react/renderer/components/image/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library( + rrc_image + SHARED + ImageEventEmitter.cpp + ImageProps.cpp + ImageShadowNode.cpp + ImageState.cpp +) + +target_include_directories(rrc_image PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(rrc_image + glog + folly_json + glog_init + jsi + react_debug + react_render_core + react_render_debug + react_render_graphics + react_render_imagemanager + react_render_mapbuffer + rrc_view + yoga +) diff --git a/ReactCommon/react/renderer/components/root/CMakeLists.txt b/ReactCommon/react/renderer/components/root/CMakeLists.txt new file mode 100644 index 00000000000..9b96943ae91 --- /dev/null +++ b/ReactCommon/react/renderer/components/root/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library(rrc_root SHARED + RootProps.cpp + RootShadowNode.cpp) + +target_include_directories(rrc_root PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(rrc_root + folly_futures + folly_json + glog + glog_init + react_debug + react_render_core + react_render_debug + react_render_graphics + rrc_view + yoga +) diff --git a/ReactCommon/react/renderer/components/scrollview/CMakeLists.txt b/ReactCommon/react/renderer/components/scrollview/CMakeLists.txt new file mode 100644 index 00000000000..ab7d8a267f2 --- /dev/null +++ b/ReactCommon/react/renderer/components/scrollview/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library( + rrc_scrollview + SHARED + ScrollViewEventEmitter.cpp + ScrollViewProps.cpp + ScrollViewShadowNode.cpp + ScrollViewState.cpp +) + +target_include_directories(rrc_scrollview PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(rrc_scrollview + glog + folly_futures + folly_json + glog_init + jsi + react_debug + react_render_core + react_render_debug + react_render_graphics + react_render_mapbuffer + rrc_view + yoga +) diff --git a/ReactCommon/react/renderer/components/text/CMakeLists.txt b/ReactCommon/react/renderer/components/text/CMakeLists.txt new file mode 100644 index 00000000000..7c4eb29c6d2 --- /dev/null +++ b/ReactCommon/react/renderer/components/text/CMakeLists.txt @@ -0,0 +1,45 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library( + rrc_text + SHARED + BaseTextProps.cpp + BaseTextShadowNode.cpp + ParagraphEventEmitter.cpp + ParagraphProps.cpp + ParagraphShadowNode.cpp + ParagraphState.cpp + RawTextProps.cpp + RawTextShadowNode.cpp + TextProps.cpp + TextShadowNode.cpp +) + +target_include_directories(rrc_text PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(rrc_text + glog + folly_json + glog_init + jsi + react_debug + react_render_attributedstring + react_render_core + react_render_debug + react_render_graphics + react_render_mapbuffer + react_render_mounting + react_render_textlayoutmanager + react_render_uimanager + react_utils + rrc_view + yoga +) diff --git a/ReactCommon/react/renderer/components/textinput/CMakeLists.txt b/ReactCommon/react/renderer/components/textinput/CMakeLists.txt new file mode 100644 index 00000000000..bce6220cbba --- /dev/null +++ b/ReactCommon/react/renderer/components/textinput/CMakeLists.txt @@ -0,0 +1,47 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library( + rrc_textinput + SHARED + androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputProps.cpp + androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.cpp + androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputState.cpp +) + +target_include_directories(rrc_textinput + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/androidtextinput/ + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/androidtextinput/react/renderer/components/androidtextinput/ +) + +target_link_libraries(rrc_textinput + glog + folly_json + glog_init + jsi + react_debug + react_render_attributedstring + react_render_componentregistry + react_render_core + react_render_debug + react_render_graphics + react_render_imagemanager + react_render_mapbuffer + react_render_mounting + react_render_textlayoutmanager + react_render_uimanager + react_utils + rrc_image + rrc_text + rrc_view + yoga +) diff --git a/ReactCommon/react/renderer/components/unimplementedview/CMakeLists.txt b/ReactCommon/react/renderer/components/unimplementedview/CMakeLists.txt new file mode 100644 index 00000000000..7c2cdf823e9 --- /dev/null +++ b/ReactCommon/react/renderer/components/unimplementedview/CMakeLists.txt @@ -0,0 +1,33 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library( + rrc_unimplementedview + SHARED + UnimplementedViewComponentDescriptor.cpp + UnimplementedViewProps.cpp + UnimplementedViewShadowNode.cpp +) + +target_include_directories(rrc_unimplementedview PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(rrc_unimplementedview + glog + folly_futures + folly_json + glog_init + jsi + react_debug + react_render_core + react_render_debug + react_render_graphics + rrc_view + yoga +) diff --git a/ReactCommon/react/renderer/components/view/CMakeLists.txt b/ReactCommon/react/renderer/components/view/CMakeLists.txt new file mode 100644 index 00000000000..5a9d0cdaf11 --- /dev/null +++ b/ReactCommon/react/renderer/components/view/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +file(GLOB rrc_view_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) + +add_library(rrc_view SHARED ${rrc_view_SRC}) + +target_include_directories(rrc_view PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(rrc_view + folly_futures + folly_json + glog + glog_init + jsi + logger + react_debug + react_render_core + react_render_debug + react_render_graphics + yoga) diff --git a/ReactCommon/react/renderer/core/CMakeLists.txt b/ReactCommon/react/renderer/core/CMakeLists.txt new file mode 100644 index 00000000000..23e0d9a8a84 --- /dev/null +++ b/ReactCommon/react/renderer/core/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +file(GLOB react_render_core_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) + +add_library(react_render_core SHARED ${react_render_core_SRC}) + +target_include_directories(react_render_core PUBLIC ${REACT_COMMON_DIR}) +target_link_libraries(react_render_core + folly_futures + folly_json + glog + jsi + react_debug + react_render_debug + react_render_graphics + react_utils) diff --git a/ReactCommon/react/renderer/debug/CMakeLists.txt b/ReactCommon/react/renderer/debug/CMakeLists.txt new file mode 100644 index 00000000000..c191207c5d9 --- /dev/null +++ b/ReactCommon/react/renderer/debug/CMakeLists.txt @@ -0,0 +1,17 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library(react_render_debug + SHARED + DebugStringConvertible.cpp + DebugStringConvertibleItem.cpp) + +target_include_directories(react_render_debug PUBLIC ${REACT_COMMON_DIR}) +target_link_libraries(react_render_debug folly_json) diff --git a/ReactCommon/react/renderer/graphics/CMakeLists.txt b/ReactCommon/react/renderer/graphics/CMakeLists.txt new file mode 100644 index 00000000000..9a455bb5eac --- /dev/null +++ b/ReactCommon/react/renderer/graphics/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library(react_render_graphics + SHARED + Transform.cpp + platform/cxx/react/renderer/graphics/Color.cpp + ) + +target_include_directories(react_render_graphics + PUBLIC + ${REACT_COMMON_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/platform/cxx/ + ) + +target_link_libraries(react_render_graphics glog fb fbjni folly_json react_debug) diff --git a/ReactCommon/react/renderer/imagemanager/CMakeLists.txt b/ReactCommon/react/renderer/imagemanager/CMakeLists.txt new file mode 100644 index 00000000000..d48d66c2854 --- /dev/null +++ b/ReactCommon/react/renderer/imagemanager/CMakeLists.txt @@ -0,0 +1,34 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library(react_render_imagemanager + SHARED + ImageResponse.cpp + ImageResponseObserverCoordinator.cpp + ImageTelemetry.cpp + platform/cxx/react/renderer/imagemanager/ImageManager.cpp + platform/cxx/react/renderer/imagemanager/ImageRequest.cpp) + +target_include_directories(react_render_imagemanager + PUBLIC + ${REACT_COMMON_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/platform/cxx/ + PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ) + +target_link_libraries(react_render_imagemanager + folly_json + react_debug + react_render_core + react_render_debug + react_render_graphics + react_render_mounting + yoga) diff --git a/ReactCommon/react/renderer/leakchecker/CMakeLists.txt b/ReactCommon/react/renderer/leakchecker/CMakeLists.txt new file mode 100644 index 00000000000..9909bcfc2e9 --- /dev/null +++ b/ReactCommon/react/renderer/leakchecker/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library(react_render_leakchecker + SHARED + LeakChecker.cpp + WeakFamilyRegistry.cpp) + +target_include_directories(react_render_leakchecker PUBLIC ${REACT_COMMON_DIR}) +target_link_libraries(react_render_leakchecker + glog + react_render_core + runtimeexecutor) diff --git a/ReactCommon/react/renderer/mapbuffer/CMakeLists.txt b/ReactCommon/react/renderer/mapbuffer/CMakeLists.txt new file mode 100644 index 00000000000..930d0a363b7 --- /dev/null +++ b/ReactCommon/react/renderer/mapbuffer/CMakeLists.txt @@ -0,0 +1,17 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library(react_render_mapbuffer + SHARED + MapBuffer.cpp + MapBufferBuilder.cpp) + +target_include_directories(react_render_mapbuffer PUBLIC ${REACT_COMMON_DIR}) +target_link_libraries(react_render_mapbuffer glog glog_init react_debug) diff --git a/ReactCommon/react/renderer/mounting/CMakeLists.txt b/ReactCommon/react/renderer/mounting/CMakeLists.txt new file mode 100644 index 00000000000..5cc54258ab1 --- /dev/null +++ b/ReactCommon/react/renderer/mounting/CMakeLists.txt @@ -0,0 +1,33 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +file(GLOB react_render_mounting_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) + +add_library(react_render_mounting SHARED ${react_render_mounting_SRC}) + +target_include_directories(react_render_mounting PRIVATE .) +target_include_directories(react_render_mounting PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(react_render_mounting + butter + folly_futures + folly_json + glog + glog_init + jsi + react_debug + react_render_core + react_render_debug + react_render_graphics + react_render_telemetry + react_utils + rrc_root + rrc_view + yoga) diff --git a/ReactCommon/react/renderer/runtimescheduler/CMakeLists.txt b/ReactCommon/react/renderer/runtimescheduler/CMakeLists.txt new file mode 100644 index 00000000000..3d089d91473 --- /dev/null +++ b/ReactCommon/react/renderer/runtimescheduler/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library( + react_render_runtimescheduler + SHARED + RuntimeScheduler.cpp + RuntimeSchedulerBinding.cpp + RuntimeSchedulerCallInvoker.cpp + Task.cpp) + +target_include_directories(react_render_runtimescheduler PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(react_render_runtimescheduler + callinvoker + jsi + react_debug + react_render_core + runtimeexecutor) diff --git a/ReactCommon/react/renderer/scheduler/CMakeLists.txt b/ReactCommon/react/renderer/scheduler/CMakeLists.txt new file mode 100644 index 00000000000..9a4b7fee93f --- /dev/null +++ b/ReactCommon/react/renderer/scheduler/CMakeLists.txt @@ -0,0 +1,43 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library( + react_render_scheduler + SHARED + AsynchronousEventBeat.cpp + Scheduler.cpp + SchedulerToolbox.cpp + SurfaceHandler.cpp + SurfaceManager.cpp + SynchronousEventBeat.cpp +) + +target_include_directories(react_render_scheduler PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(react_render_scheduler + folly_futures + folly_json + glog + jsi + react_config + react_debug + react_render_componentregistry + react_render_core + react_render_debug + react_render_graphics + react_render_mounting + react_render_runtimescheduler + react_render_templateprocessor + react_render_uimanager + react_utils + rrc_root + rrc_view + yoga +) diff --git a/ReactCommon/react/renderer/telemetry/CMakeLists.txt b/ReactCommon/react/renderer/telemetry/CMakeLists.txt new file mode 100644 index 00000000000..b1d04a0e542 --- /dev/null +++ b/ReactCommon/react/renderer/telemetry/CMakeLists.txt @@ -0,0 +1,30 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library(react_render_telemetry + SHARED + SurfaceTelemetry.cpp + TransactionTelemetry.cpp) + +target_include_directories(react_render_telemetry PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(react_render_telemetry + butter + folly_futures + folly_json + glog + glog_init + react_debug + react_render_core + react_render_debug + react_utils + rrc_root + rrc_view + yoga) diff --git a/ReactCommon/react/renderer/templateprocessor/CMakeLists.txt b/ReactCommon/react/renderer/templateprocessor/CMakeLists.txt new file mode 100644 index 00000000000..5f77bbdd532 --- /dev/null +++ b/ReactCommon/react/renderer/templateprocessor/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library(react_render_templateprocessor + SHARED + UITemplateProcessor.cpp) + +target_include_directories(react_render_templateprocessor PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(react_render_templateprocessor + folly_futures + folly_json + glog + jsi + react_config + react_render_componentregistry + react_render_core + react_render_debug + react_render_uimanager + react_utils +) diff --git a/ReactCommon/react/renderer/textlayoutmanager/CMakeLists.txt b/ReactCommon/react/renderer/textlayoutmanager/CMakeLists.txt new file mode 100644 index 00000000000..c0e56031471 --- /dev/null +++ b/ReactCommon/react/renderer/textlayoutmanager/CMakeLists.txt @@ -0,0 +1,44 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library(react_render_textlayoutmanager + SHARED + TextMeasureCache.cpp + platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp +) + +target_include_directories(react_render_textlayoutmanager + PUBLIC + ${REACT_COMMON_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/platform/android/ +) + +target_link_libraries(react_render_textlayoutmanager + glog + fb + fbjni + folly_futures + folly_json + glog_init + mapbufferjni + react_debug + react_render_attributedstring + react_render_componentregistry + react_render_core + react_render_debug + react_render_graphics + react_render_mapbuffer + react_render_mounting + react_render_telemetry + react_render_uimanager + react_utils + reactnativeutilsjni + yoga +) diff --git a/ReactCommon/react/renderer/uimanager/CMakeLists.txt b/ReactCommon/react/renderer/uimanager/CMakeLists.txt new file mode 100644 index 00000000000..03cf17135da --- /dev/null +++ b/ReactCommon/react/renderer/uimanager/CMakeLists.txt @@ -0,0 +1,37 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +add_library(react_render_uimanager + SHARED + bindingUtils.cpp + SurfaceRegistryBinding.cpp + UIManager.cpp + UIManagerBinding.cpp) + +target_include_directories(react_render_uimanager PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(react_render_uimanager + glog + folly_futures + folly_json + jsi + react_debug + react_render_componentregistry + react_render_core + react_render_debug + react_render_graphics + react_render_leakchecker + react_render_runtimescheduler + react_render_mounting + react_config + rrc_root + rrc_view + runtimeexecutor +) diff --git a/ReactCommon/react/utils/CMakeLists.txt b/ReactCommon/react/utils/CMakeLists.txt new file mode 100644 index 00000000000..8476c5c4e3e --- /dev/null +++ b/ReactCommon/react/utils/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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options( + -fexceptions + -frtti + -std=c++17 + -Wall + -DLOG_TAG=\"Fabric\") + +add_library(react_utils + SHARED + ManagedObjectWrapper.mm + RunLoopObserver.cpp) + +target_include_directories(react_utils PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(react_utils + glog + glog_init + react_debug + react_render_mapbuffer) diff --git a/ReactCommon/reactperflogger/CMakeLists.txt b/ReactCommon/reactperflogger/CMakeLists.txt new file mode 100644 index 00000000000..257f0b2cc69 --- /dev/null +++ b/ReactCommon/reactperflogger/CMakeLists.txt @@ -0,0 +1,15 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall) + +add_library(reactperflogger + STATIC + reactperflogger/BridgeNativeModulePerfLogger.cpp) + +target_include_directories(reactperflogger PUBLIC .) diff --git a/ReactCommon/runtimeexecutor/CMakeLists.txt b/ReactCommon/runtimeexecutor/CMakeLists.txt new file mode 100644 index 00000000000..86af520bd86 --- /dev/null +++ b/ReactCommon/runtimeexecutor/CMakeLists.txt @@ -0,0 +1,13 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall) + +add_library(runtimeexecutor INTERFACE) + +target_include_directories(runtimeexecutor INTERFACE .) diff --git a/ReactCommon/yoga/CMakeLists.txt b/ReactCommon/yoga/CMakeLists.txt new file mode 100644 index 00000000000..353fc79617c --- /dev/null +++ b/ReactCommon/yoga/CMakeLists.txt @@ -0,0 +1,16 @@ +# 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.4.1) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -O3 -Wall) + +file(GLOB_RECURSE yogacore_SRC yoga/*.cpp) +add_library(yogacore STATIC ${yogacore_SRC}) + +target_include_directories(yogacore PUBLIC .) + +target_link_libraries(yogacore android log)