Skip to content

append to CMAKE_FIND_ROOT_PATH instead of setting executorch_DIR #12618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 48 commits into from
Jul 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
9e3e2e7
Update
swolchok Jul 13, 2025
16f0274
forgot to amend
swolchok Jul 13, 2025
99ec5a7
Update
swolchok Jul 14, 2025
ff3cdb9
Update
swolchok Jul 14, 2025
513de13
Update
swolchok Jul 14, 2025
76db1f1
Update
swolchok Jul 14, 2025
08bffac
Update
swolchok Jul 14, 2025
dff96c8
Update
swolchok Jul 14, 2025
0e2bce6
Update
swolchok Jul 14, 2025
35d8319
Update
swolchok Jul 14, 2025
a31187e
Update
swolchok Jul 15, 2025
dcbce0d
Update
swolchok Jul 15, 2025
bc8f971
Update
swolchok Jul 15, 2025
29d3999
Update
swolchok Jul 15, 2025
7e4040a
Update
swolchok Jul 15, 2025
2dacf6f
Update
swolchok Jul 15, 2025
fb2b775
Update
swolchok Jul 15, 2025
02f19a6
Update
swolchok Jul 15, 2025
225d5a6
Update
swolchok Jul 15, 2025
41bf264
Update
swolchok Jul 16, 2025
f54a8ce
Update
swolchok Jul 16, 2025
e48e6cc
Update
swolchok Jul 16, 2025
a2f14ac
Update
swolchok Jul 16, 2025
c31a4b9
Update
swolchok Jul 17, 2025
4fd7372
Update
swolchok Jul 17, 2025
d650396
Update
swolchok Jul 17, 2025
3bfdade
Update
swolchok Jul 17, 2025
00acd77
Update
swolchok Jul 17, 2025
6946143
Update
swolchok Jul 17, 2025
431ddd8
Update
swolchok Jul 17, 2025
60456ca
Update
swolchok Jul 17, 2025
dcb3ca0
Update
swolchok Jul 18, 2025
3c30b31
Update
swolchok Jul 18, 2025
e9928a7
Update
swolchok Jul 18, 2025
b57678b
Update
swolchok Jul 18, 2025
05effc4
Update
swolchok Jul 18, 2025
f5bcdcc
Update
swolchok Jul 18, 2025
2e21d9a
Update
swolchok Jul 19, 2025
63e4a27
Update
swolchok Jul 19, 2025
4c2e046
rebase
swolchok Jul 19, 2025
0eb3d8d
rebase
swolchok Jul 19, 2025
a451cc3
rebase
swolchok Jul 19, 2025
ccd0e2d
Update
swolchok Jul 21, 2025
f9b96eb
Update
swolchok Jul 21, 2025
02d6d67
Update
swolchok Jul 21, 2025
995f6fa
Update
swolchok Jul 22, 2025
a06c916
Merge branch 'main' into gh/swolchok/517/head
swolchok Jul 22, 2025
3d760e0
Update
swolchok Jul 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions examples/models/llama/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,11 @@ find_package(gflags REQUIRED)
# llama_main: test binary to run llama, with tokenizer and sampler integrated
#

# find `executorch` libraries Same as for gflags
set(executorch_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../../lib/cmake/ExecuTorch)
find_package(executorch CONFIG REQUIRED)
# find `executorch` libraries. CMAKE_PREFIX_PATH would work for host
# compilation, but CMAKE_FIND_ROOT_PATH appears to be necessary for
# cross-compiling (e.g., to Android) to work as well.
list(APPEND CMAKE_FIND_ROOT_PATH ${CMAKE_CURRENT_BINARY_DIR}/../../..)
find_package(executorch CONFIG REQUIRED FIND_ROOT_PATH_BOTH)
target_link_options_shared_lib(executorch)

# llama_runner library
Expand Down
4 changes: 2 additions & 2 deletions examples/models/llava/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ find_package(gflags REQUIRED)
#

# find `executorch` libraries Same as for gflags
set(executorch_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../../lib/cmake/ExecuTorch)
find_package(executorch CONFIG REQUIRED)
list(APPEND CMAKE_FIND_ROOT_PATH ${CMAKE_CURRENT_BINARY_DIR}/../../..)
find_package(executorch CONFIG REQUIRED FIND_ROOT_PATH_BOTH)
target_link_options_shared_lib(executorch)

# llava_runner library
Expand Down
4 changes: 2 additions & 2 deletions examples/models/phi-3-mini/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ set(EXECUTORCH_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../../..")
set(_common_include_directories
${EXECUTORCH_ROOT}/.. ${EXECUTORCH_ROOT}/runtime/core/portable_type/c10
)
set(executorch_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../../lib/cmake/ExecuTorch)
find_package(executorch CONFIG REQUIRED)
list(APPEND CMAKE_FIND_ROOT_PATH ${CMAKE_CURRENT_BINARY_DIR}/../../..)
find_package(executorch CONFIG REQUIRED FIND_ROOT_PATH_BOTH)

target_link_options_shared_lib(executorch)

Expand Down
1 change: 0 additions & 1 deletion extension/android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ set_target_properties(fbjni PROPERTIES
IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/third-party/fbjni/prefab/modules/fbjni/libs/android.${ANDROID_ABI}/libfbjni.so"
)

set(executorch_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../lib/cmake/ExecuTorch)
target_link_options_shared_lib(executorch)

add_library(executorch_jni SHARED jni/jni_layer.cpp jni/log.cpp jni/jni_layer_runtime.cpp)
Expand Down
Loading