-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
77ff3f6
commit 4e0ffd6
Showing
3 changed files
with
103 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
set(CMAKE_VERBOSE_MAKEFILE ON) | ||
set(CMAKE_CXX_STANDARD 20) | ||
|
||
set(LIB_LITERAL JBAnimatedText) | ||
set(LIB_TARGET_NAME react_codegen_${LIB_LITERAL}) | ||
|
||
set(LIB_ANDROID_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../..) | ||
set(LIB_CPP_DIR ${LIB_ANDROID_DIR}/../cpp) | ||
set(LIB_CUSTOM_SOURCES_DIR ${LIB_CPP_DIR}/react/renderer/components/${LIB_LITERAL}) | ||
set(LIB_ANDROID_GENERATED_JNI_DIR ${LIB_ANDROID_DIR}/build/generated/source/codegen/jni) | ||
set(LIB_ANDROID_GENERATED_COMPONENTS_DIR ${LIB_ANDROID_GENERATED_JNI_DIR}/react/renderer/components/${LIB_LITERAL}) | ||
|
||
file(GLOB LIB_MODULE_SRCS CONFIGURE_DEPENDS *.cpp) | ||
file(GLOB LIB_CUSTOM_SRCS CONFIGURE_DEPENDS ${LIB_CUSTOM_SOURCES_DIR}/*.cpp) | ||
file(GLOB LIB_CODEGEN_SRCS CONFIGURE_DEPENDS ${LIB_ANDROID_GENERATED_COMPONENTS_DIR}/*.cpp) | ||
|
||
set(RN_DIR ${LIB_ANDROID_DIR}/../example/node_modules/react-native) | ||
|
||
add_library( | ||
${LIB_TARGET_NAME} | ||
SHARED | ||
${LIB_MODULE_SRCS} | ||
${LIB_CUSTOM_SRCS} | ||
${LIB_CODEGEN_SRCS} | ||
) | ||
|
||
target_include_directories( | ||
${LIB_TARGET_NAME} | ||
PUBLIC | ||
. | ||
${LIB_ANDROID_GENERATED_JNI_DIR} | ||
${LIB_ANDROID_GENERATED_COMPONENTS_DIR} | ||
${LIB_CPP_DIR} | ||
) | ||
|
||
find_package(fbjni REQUIRED CONFIG) | ||
find_package(ReactAndroid REQUIRED CONFIG) | ||
|
||
target_link_libraries( | ||
${LIB_TARGET_NAME} | ||
fbjni::fbjni | ||
ReactAndroid::jsi | ||
) | ||
|
||
if (ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) | ||
target_link_libraries( | ||
${LIB_TARGET_NAME} | ||
ReactAndroid::reactnative | ||
) | ||
else () | ||
message(FATAL_ERROR "react-native-live-markdown requires react-native 0.76 or newer.") | ||
endif () | ||
|
||
target_compile_options( | ||
${LIB_TARGET_NAME} | ||
PRIVATE | ||
-DLOG_TAG=\"ReactNative\" | ||
-fexceptions | ||
-frtti | ||
-Wall | ||
-std=c++20 | ||
) | ||
|
||
target_include_directories( | ||
${CMAKE_PROJECT_NAME} | ||
PUBLIC | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#pragma once | ||
|
||
#include <ReactCommon/JavaTurboModule.h> | ||
#include <ReactCommon/TurboModule.h> | ||
#include <jsi/jsi.h> | ||
#include <react/renderer/components/JBAnimatedText/ParagraphComponentDescriptor.h> | ||
|
||
namespace facebook { | ||
namespace react { | ||
|
||
JSI_EXPORT | ||
std::shared_ptr<TurboModule> JBAnimatedText_ModuleProvider( | ||
const std::string &moduleName, | ||
const JavaTurboModule::InitParams ¶ms) { | ||
|
||
// Ensure moduleName matches the expected name | ||
return nullptr; | ||
} | ||
|
||
|
||
} // namespace react | ||
} // namespace facebook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters