File tree Expand file tree Collapse file tree 4 files changed +9
-8
lines changed Expand file tree Collapse file tree 4 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -77,9 +77,11 @@ find_package(gflags REQUIRED)
77
77
# llama_main: test binary to run llama, with tokenizer and sampler integrated
78
78
#
79
79
80
- # find `executorch` libraries Same as for gflags
81
- set (executorch_DIR ${CMAKE_CURRENT_BINARY_DIR} /../../../lib/cmake/ExecuTorch )
82
- find_package (executorch CONFIG REQUIRED )
80
+ # find `executorch` libraries. CMAKE_PREFIX_PATH would work for host
81
+ # compilation, but CMAKE_FIND_ROOT_PATH appears to be necessary for
82
+ # cross-compiling (e.g., to Android) to work as well.
83
+ list (APPEND CMAKE_FIND_ROOT_PATH ${CMAKE_CURRENT_BINARY_DIR} /../../.. )
84
+ find_package (executorch CONFIG REQUIRED FIND_ROOT_PATH_BOTH )
83
85
target_link_options_shared_lib (executorch )
84
86
85
87
# llama_runner library
Original file line number Diff line number Diff line change @@ -76,8 +76,8 @@ find_package(gflags REQUIRED)
76
76
#
77
77
78
78
# find `executorch` libraries Same as for gflags
79
- set ( executorch_DIR ${CMAKE_CURRENT_BINARY_DIR} /../../../lib/cmake/ExecuTorch )
80
- find_package (executorch CONFIG REQUIRED )
79
+ list ( APPEND CMAKE_FIND_ROOT_PATH ${CMAKE_CURRENT_BINARY_DIR} /../../.. )
80
+ find_package (executorch CONFIG REQUIRED FIND_ROOT_PATH_BOTH )
81
81
target_link_options_shared_lib (executorch )
82
82
83
83
# llava_runner library
Original file line number Diff line number Diff line change @@ -24,8 +24,8 @@ set(EXECUTORCH_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../../..")
24
24
set (_common_include_directories
25
25
${EXECUTORCH_ROOT} /.. ${EXECUTORCH_ROOT} /runtime/core/portable_type/c10
26
26
)
27
- set ( executorch_DIR ${CMAKE_CURRENT_BINARY_DIR} /../../../lib/cmake/ExecuTorch )
28
- find_package (executorch CONFIG REQUIRED )
27
+ list ( APPEND CMAKE_FIND_ROOT_PATH ${CMAKE_CURRENT_BINARY_DIR} /../../.. )
28
+ find_package (executorch CONFIG REQUIRED FIND_ROOT_PATH_BOTH )
29
29
30
30
target_link_options_shared_lib (executorch )
31
31
Original file line number Diff line number Diff line change @@ -60,7 +60,6 @@ set_target_properties(fbjni PROPERTIES
60
60
IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR} /third-party/fbjni/prefab/modules/fbjni/libs/android.${ANDROID_ABI} /libfbjni.so"
61
61
)
62
62
63
- set (executorch_DIR ${CMAKE_CURRENT_BINARY_DIR} /../../lib/cmake/ExecuTorch )
64
63
target_link_options_shared_lib (executorch )
65
64
66
65
add_library (executorch_jni SHARED jni/jni_layer.cpp jni/log.cpp jni/jni_layer_runtime.cpp )
You can’t perform that action at this time.
0 commit comments