Skip to content

Commit f1ea7bb

Browse files
fix: support for react native 0.81 on Android (#722)
1 parent 338b916 commit f1ea7bb

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

package/android/src/main/jni/CMakeLists.txt

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@ set(LIB_COMMON_DIR ${LIB_ANDROID_DIR}/../common/cpp)
99
set(LIB_ANDROID_GENERATED_JNI_DIR ${LIB_ANDROID_DIR}/build/generated/source/codegen/jni)
1010
set(LIB_ANDROID_GENERATED_COMPONENTS_DIR ${LIB_ANDROID_GENERATED_JNI_DIR}/react/renderer/components/${LIB_LITERAL})
1111

12-
add_compile_options(
13-
-fexceptions
14-
-frtti
15-
-std=c++20
16-
-Wall
17-
-Wpedantic
18-
-Wno-gnu-zero-variadic-macro-arguments
19-
)
20-
2112
file(GLOB LIB_CUSTOM_SRCS CONFIGURE_DEPENDS *.cpp ${LIB_COMMON_DIR}/react/renderer/components/${LIB_LITERAL}/*.cpp)
2213
file(GLOB LIB_CODEGEN_SRCS CONFIGURE_DEPENDS ${LIB_ANDROID_GENERATED_JNI_DIR}/*.cpp ${LIB_ANDROID_GENERATED_COMPONENTS_DIR}/*.cpp)
2314

@@ -70,6 +61,21 @@ else()
7061
)
7162
endif()
7263

64+
if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 81)
65+
target_compile_reactnative_options(${LIB_TARGET_NAME} PUBLIC)
66+
else()
67+
target_compile_options(
68+
${LIB_TARGET_NAME}
69+
PRIVATE
70+
-fexceptions
71+
-frtti
72+
-std=c++20
73+
-Wall
74+
-Wpedantic
75+
-Wno-gnu-zero-variadic-macro-arguments
76+
)
77+
endif()
78+
7379
target_compile_options(
7480
${LIB_TARGET_NAME}
7581
PRIVATE

0 commit comments

Comments
 (0)