Skip to content

Commit fe5967a

Browse files
committed
Use ExternalProject_Add to build tokenizers
This way it avoids the CMake target name collision between XNNPACK's `memory` and Abseil's `memory`
1 parent 3afd18d commit fe5967a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

extension/llm/runner/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ add_subdirectory(
5252
${EXECUTORCH_ROOT}/extension/llm/tokenizers
5353
${CMAKE_CURRENT_BINARY_DIR}/../../../extension/llm/tokenizers
5454
)
55-
56-
set(runner_deps executorch_core extension_module extension_tensor tokenizers)
55+
add_dependencies(extension_llm_runner tokenizers_external_project)
56+
find_package(tokenizers CONFIG HINTS ${CMAKE_INSTALL_PREFIX} ${CMAKE_CURRENT_BINARY_DIR}/../tokenizers)
57+
set(runner_deps executorch extension_module extension_tensor ${TOKENIZERS_LIBRARIES})
5758

5859
target_link_libraries(extension_llm_runner PUBLIC ${runner_deps})
5960
set_target_properties(extension_llm_runner PROPERTIES POSITION_INDEPENDENT_CODE ON)

0 commit comments

Comments
 (0)