File tree Expand file tree Collapse file tree 1 file changed +27
-3
lines changed Expand file tree Collapse file tree 1 file changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,33 @@ include(${EXECUTORCH_ROOT}/build/Utils.cmake)
21
21
set (_common_compile_options -Wno-deprecated-declarations -fPIC )
22
22
set (_common_include_directories ${EXECUTORCH_ROOT} /.. )
23
23
24
- add_subdirectory (
25
- ${EXECUTORCH_ROOT} /examples/third-party/fbjni
26
- ${CMAKE_CURRENT_BINARY_DIR} /third-party/fbjni
24
+ if (NOT FBJNI_VERSION )
25
+ set (FBJNI_VERSION 0.5.2 )
26
+ endif ()
27
+ set (FBJNI_AAR_URL https://repo1.maven.org/maven2/com/facebook/fbjni/fbjni/${FBJNI_VERSION}/fbjni-${FBJNI_VERSION}.aar )
28
+ set (FBJNI_DOWNLOAD_PATH ${CMAKE_CURRENT_BINARY_DIR} /third-party/fbjni/fbjni.aar )
29
+
30
+ if (NOT EXISTS "${FBJNI_DOWNLOAD_PATH} " )
31
+ file (DOWNLOAD "${FBJNI_AAR_URL} " "${FBJNI_DOWNLOAD_PATH} " )
32
+ endif ()
33
+
34
+ add_custom_command (
35
+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR} /third-party/fbjni/prefab/modules/fbjni/include/" "${CMAKE_CURRENT_BINARY_DIR} /third-party/fbjni/prefab/modules/fbjni/libs/android.${ANDROID_ABI} /libfbjni.so"
36
+ COMMAND unzip -o ${FBJNI_DOWNLOAD_PATH} -d ${CMAKE_CURRENT_BINARY_DIR} /third-party/fbjni
37
+ DEPENDS "${FBJNI_DOWNLOAD_PATH} " )
38
+
39
+ add_custom_target (
40
+ fbjni_prefab
41
+ DEPENDS "${CMAKE_CURRENT_BINARY_DIR} /third-party/fbjni/prefab/modules/fbjni/include/" "${CMAKE_CURRENT_BINARY_DIR} /third-party/fbjni/prefab/modules/fbjni/libs/android.${ANDROID_ABI} /libfbjni.so"
42
+ )
43
+
44
+ add_library (fbjni SHARED IMPORTED )
45
+ add_dependencies (fbjni fbjni_prefab )
46
+ set_target_properties (fbjni PROPERTIES
47
+ IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR} /third-party/fbjni/prefab/modules/fbjni/libs/android.${ANDROID_ABI} /libfbjni.so"
48
+ )
49
+ list (APPEND
50
+ _common_include_directories "${CMAKE_CURRENT_BINARY_DIR} /third-party/fbjni/prefab/modules/fbjni/include/"
27
51
)
28
52
29
53
set (executorch_DIR ${CMAKE_CURRENT_BINARY_DIR} /../../lib/cmake/ExecuTorch )
You can’t perform that action at this time.
0 commit comments