4
4
# This source code is licensed under the BSD-style license found in the
5
5
# LICENSE file in the root directory of this source tree.
6
6
7
-
8
7
cmake_minimum_required (VERSION 3.19 )
9
8
10
9
project (executorch_jni )
@@ -14,22 +13,32 @@ include(${EXECUTORCH_ROOT}/build/Utils.cmake)
14
13
15
14
set (_common_include_directories ${EXECUTORCH_ROOT} /.. )
16
15
17
- add_subdirectory (
18
- ${EXECUTORCH_ROOT} /examples/third-party/fbjni
19
- ${CMAKE_CURRENT_BINARY_DIR} /third-party/fbjni )
16
+ add_subdirectory (${EXECUTORCH_ROOT} /examples/third-party/fbjni
17
+ ${CMAKE_CURRENT_BINARY_DIR} /third-party/fbjni )
20
18
21
19
if (CMAKE_TOOLCHAIN_ANDROID )
22
- add_library (executorch_jni SHARED jni/jni_layer.cpp )
23
- target_link_libraries (executorch_jni extension_data_loader
24
- extension_module xnn_executor_runner_lib fbjni )
25
- if (EXECUTORCH_BUILD_QNN )
26
- target_link_libraries (executorch_jni qnn_executorch_backend )
27
- endif ()
28
- target_compile_options (executorch_jni PUBLIC ${_common_compile_options} )
29
-
30
- add_library (executorch_llama_jni SHARED jni/jni_layer_llama.cpp )
31
- target_link_libraries (executorch_llama_jni fbjni llama_runner
32
- xnn_executor_runner_lib )
33
- target_compile_options (executorch_llama_jni PUBLIC
34
- ${_common_compile_options} )
20
+ add_library (executorch_jni SHARED jni/jni_layer.cpp )
21
+ target_link_libraries (executorch_jni extension_data_loader extension_module
22
+ fbjni )
23
+ if (EXECUTORCH_BUILD_QNN )
24
+ target_link_libraries (executorch_jni qnn_executorch_backend )
25
+ endif ()
26
+ if (EXECUTORCH_BUILD_XNNPACK )
27
+ target_link_libraries (executorch_jni xnn_executor_runner_lib )
28
+ endif ()
29
+ if (EXECUTORCH_BUILD_VULKAN )
30
+ target_link_libraries (executorch_jni vulkan_executor_runner_lib )
31
+ endif ()
32
+ target_compile_options (executorch_jni PUBLIC ${_common_compile_options} )
33
+
34
+ add_library (executorch_llama_jni SHARED jni/jni_layer_llama.cpp )
35
+ target_link_libraries (executorch_llama_jni fbjni llama_runner )
36
+ if (EXECUTORCH_BUILD_XNNPACK )
37
+ target_link_libraries (executorch_llama_jni xnn_executor_runner_lib )
38
+ endif ()
39
+ if (EXECUTORCH_BUILD_VULKAN )
40
+ target_link_libraries (executorch_llama_jni vulkan_executor_runner_lib )
41
+ endif ()
42
+
43
+ target_compile_options (executorch_llama_jni PUBLIC ${_common_compile_options} )
35
44
endif ()
0 commit comments