Skip to content

Commit 38e88df

Browse files
cmodi-metakirklandsign
authored andcommitted
Cmake to include mtk target source
1 parent 826d59d commit 38e88df

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

extension/android/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,26 @@ if(EXECUTORCH_BUILD_LLAMA_JNI)
158158
${EXECUTORCH_ROOT}/examples/models/llama/runner
159159
${CMAKE_CURRENT_BINARY_DIR}/../../examples/models/llama/runner
160160
)
161+
162+
target_sources(
163+
executorch_jni PRIVATE
164+
${EXECUTORCH_ROOT}/examples/mediatek/executor_runner/mtk_llama_runner.cpp
165+
${EXECUTORCH_ROOT}/examples/mediatek/executor_runner/llama_runner/LlamaModelChunk.cpp
166+
${EXECUTORCH_ROOT}/examples/mediatek/executor_runner/llama_runner/LlamaRuntime.cpp
167+
${EXECUTORCH_ROOT}/examples/mediatek/executor_runner/llama_runner/ModelChunk.cpp
168+
${EXECUTORCH_ROOT}/examples/mediatek/executor_runner/llama_runner/MultiModelLoader.cpp
169+
${EXECUTORCH_ROOT}/examples/mediatek/executor_runner/llama_runner/llm_helper/mask_builder.cpp
170+
${EXECUTORCH_ROOT}/examples/mediatek/executor_runner/llama_runner/llm_helper/rotary_embedding.cpp
171+
${EXECUTORCH_ROOT}/examples/mediatek/executor_runner/llama_runner/llm_helper/token_embedding.cpp
172+
)
173+
target_include_directories(
174+
executorch_jni PRIVATE
175+
${EXECUTORCH_ROOT}/examples/mediatek/executor_runner/
176+
${EXECUTORCH_ROOT}/examples/mediatek/executor_runner/llama_runner
177+
)
178+
ADD_LIBRARY(libneuron_buffer_allocator SHARED IMPORTED)
179+
SET_PROPERTY(TARGET libneuron_buffer_allocator PROPERTY IMPORTED_LOCATION ${NEURON_BUFFER_ALLOCATOR_LIB}/libneuron_buffer_allocator.so)
180+
list(APPEND link_libraries neuron_backend libneuron_buffer_allocator)
161181
endif()
162182

163183
target_include_directories(

0 commit comments

Comments
 (0)