File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed
packages/react-native-executorch/android Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,20 @@ cmake_minimum_required(VERSION 3.13)
22project (RnExecutorch)
33
44set (CMAKE_VERBOSE_MAKEFILE ON )
5+ set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
56set (CMAKE_CXX_STANDARD 20)
67
78include ("${REACT_NATIVE_DIR} /ReactAndroid/cmake-utils/folly-flags.cmake" )
89add_compile_options (${folly_FLAGS} )
910
11+
12+ if (ReactAndroid_VERSION_MINOR GREATER_EQUAL 80)
13+ include ("${REACT_NATIVE_DIR} /ReactCommon/cmake-utils/react-native-flags.cmake" )
14+ target_compile_reactnative_options (react-native-executorch PRIVATE )
15+ else ()
16+ string (APPEND CMAKE_CXX_FLAGS " -O2 -fstack-protector-all -fexceptions -frtti -std=c++${CMAKE_CXX_STANDARD} -Wall" )
17+ endif ()
18+
1019string (APPEND CMAKE_CXX_FLAGS " -DRCT_NEW_ARCH_ENABLED" )
1120
1221set (ANDROID_CPP_DIR "${CMAKE_SOURCE_DIR} /src/main/cpp" )
Original file line number Diff line number Diff line change @@ -117,7 +117,6 @@ android {
117117 targetSdkVersion getExtOrIntegerDefault(" targetSdkVersion" )
118118 externalNativeBuild {
119119 cmake {
120- cppFlags " -O2 -frtti -fexceptions -Wall -fstack-protector-all -fopenmp -static-openmp"
121120 abiFilters (* reactNativeArchitectures())
122121 arguments " -DANDROID_STL=c++_shared" ,
123122 " -DREACT_NATIVE_DIR=${ toPlatformFileString(reactNativeRootDir.path)} " ,
Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.13 )
22
33file (GLOB_RECURSE ANDROID_CPP_SOURCES CONFIGURE_DEPENDS "${ANDROID_CPP_DIR} /*.cpp" )
4- file (GLOB_RECURSE COMMON_CPP_SOURCES CONFIGURE_DEPENDS "${COMMON_CPP_DIR} /*.cpp" "${COMMON_CPP_DIR} /*.c" )
4+ file (GLOB_RECURSE COMMON_CPP_SOURCES CONFIGURE_DEPENDS "${COMMON_CPP_DIR} /*.cpp" )
5+ file (GLOB_RECURSE COMMON_C_SOURCES CONFIGURE_DEPENDS "${COMMON_CPP_DIR} /*.c" )
56file (GLOB_RECURSE TEST_CPP_SOURCES "${COMMON_CPP_DIR} /rnexecutorch/tests/*.cpp" )
67list (REMOVE_ITEM COMMON_CPP_SOURCES ${TEST_CPP_SOURCES} )
78
8- add_library (react-native-executorch SHARED ${ANDROID_CPP_SOURCES} ${COMMON_CPP_SOURCES} )
9+ add_library (react-native-executorch SHARED ${ANDROID_CPP_SOURCES} ${COMMON_CPP_SOURCES} ${COMMON_C_SOURCES} )
910
1011find_package (ReactAndroid REQUIRED CONFIG )
1112find_package (fbjni REQUIRED CONFIG )
@@ -96,6 +97,8 @@ set(TOKENIZERS_THIRD_PARTY_LIBS
9697
9798# --------------
9899
100+ target_link_options (react-native-executorch PRIVATE -fopenmp -static-openmp )
101+
99102target_link_libraries (
100103 react-native-executorch
101104 ${LINK_LIBRARIES}
You can’t perform that action at this time.
0 commit comments