Skip to content

Commit c097f9f

Browse files
committed
Cmake to include mtk target source
1 parent 5424791 commit c097f9f

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
@@ -155,6 +155,26 @@ if(EXECUTORCH_BUILD_LLAMA_JNI)
155155
${EXECUTORCH_ROOT}/examples/models/llama2/runner
156156
${CMAKE_CURRENT_BINARY_DIR}/../../examples/models/llama2/runner
157157
)
158+
159+
target_sources(
160+
executorch_jni PRIVATE
161+
${EXECUTORCH_ROOT}/examples/mediatek/executor_runner/mtk_llama_runner.cpp
162+
${EXECUTORCH_ROOT}/examples/mediatek/executor_runner/llama_runner/LlamaModelChunk.cpp
163+
${EXECUTORCH_ROOT}/examples/mediatek/executor_runner/llama_runner/LlamaRuntime.cpp
164+
${EXECUTORCH_ROOT}/examples/mediatek/executor_runner/llama_runner/ModelChunk.cpp
165+
${EXECUTORCH_ROOT}/examples/mediatek/executor_runner/llama_runner/MultiModelLoader.cpp
166+
${EXECUTORCH_ROOT}/examples/mediatek/executor_runner/llama_runner/llm_helper/mask_builder.cpp
167+
${EXECUTORCH_ROOT}/examples/mediatek/executor_runner/llama_runner/llm_helper/rotary_embedding.cpp
168+
${EXECUTORCH_ROOT}/examples/mediatek/executor_runner/llama_runner/llm_helper/token_embedding.cpp
169+
)
170+
target_include_directories(
171+
executorch_jni PRIVATE
172+
${EXECUTORCH_ROOT}/examples/mediatek/executor_runner/
173+
${EXECUTORCH_ROOT}/examples/mediatek/executor_runner/llama_runner
174+
)
175+
ADD_LIBRARY(libneuron_buffer_allocator SHARED IMPORTED)
176+
SET_PROPERTY(TARGET libneuron_buffer_allocator PROPERTY IMPORTED_LOCATION ${NEURON_BUFFER_ALLOCATOR_LIB}/libneuron_buffer_allocator.so)
177+
list(APPEND link_libraries neuron_backend libneuron_buffer_allocator)
158178
endif()
159179

160180
target_include_directories(

0 commit comments

Comments
 (0)