-
Notifications
You must be signed in to change notification settings - Fork 429
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ghstack-source-id: a10394db3f494e2848be8f64f0e547610683bde9 Pull Request resolved: #4354
- Loading branch information
1 parent
b7fb9bd
commit 2ff1f9b
Showing
3 changed files
with
642 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# All rights reserved. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
# | ||
# Simple CMake build system for selective build demo. | ||
# | ||
# ### Editing this file ### | ||
# | ||
# This file should be formatted with | ||
# ~~~ | ||
# cmake-format -i CMakeLists.txt | ||
# ~~~ | ||
# It should also be cmake-lint clean. | ||
# | ||
|
||
if(NOT EXECUTORCH_ROOT) | ||
set(EXECUTORCH_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../../..) | ||
endif() | ||
|
||
include(${EXECUTORCH_ROOT}/build/Utils.cmake) | ||
include(${EXECUTORCH_ROOT}/build/Codegen.cmake) | ||
|
||
# | ||
# The `_<target>_srcs` lists are defined by including ${EXECUTORCH_SRCS_FILE}. | ||
# | ||
set(EXECUTORCH_SRCS_FILE | ||
"${CMAKE_CURRENT_BINARY_DIR}/../../../../executorch_srcs.cmake" | ||
) | ||
|
||
# extract_sources(${EXECUTORCH_SRCS_FILE}) | ||
|
||
# include(${EXECUTORCH_SRCS_FILE}) | ||
|
||
# build multimodal_runner library | ||
set(_multimodal_runner__srcs | ||
"${CMAKE_CURRENT_SOURCE_DIR}/multimodal_runner.cpp" | ||
) | ||
|
||
target_include_directories( | ||
extension_module INTERFACE ${_common_include_directories} | ||
) | ||
|
||
if(EXECUTORCH_USE_TIKTOKEN) | ||
list(APPEND _multimodal_runner__srcs | ||
${CMAKE_CURRENT_SOURCE_DIR}/../../../../extension/llm/tokenizer/tiktoken.cpp | ||
) | ||
list(APPEND _multimodal_runner__srcs | ||
${CMAKE_CURRENT_SOURCE_DIR}/../tokenizer/llama_tiktoken.cpp | ||
) | ||
set(_preprocessor_flag -DET_USE_TIKTOKEN) | ||
endif() | ||
|
||
if(CMAKE_TOOLCHAIN_IOS | ||
OR ANDROID | ||
OR APPLE | ||
) | ||
# Building a share library on iOS requires code signing On Android we see | ||
# duplicated registration when using shared lib | ||
add_library(multimodal_runner STATIC ${_multimodal_runner__srcs}) | ||
else() | ||
add_library(multimodal_runner SHARED ${_multimodal_runner__srcs}) | ||
endif() | ||
|
||
set(multimodal_runner_deps executorch extension_module extension_data_loader) | ||
|
||
target_link_libraries(multimodal_runner PUBLIC ${multimodal_runner_deps}) | ||
|
||
target_include_directories( | ||
multimodal_runner INTERFACE ${_common_include_directories} ${EXECUTORCH_ROOT} | ||
) | ||
target_compile_options(multimodal_runner PUBLIC ${_preprocessor_flag}) |
Oops, something went wrong.