Skip to content

Commit ec234e5

Browse files
authored
Add option to build only mtmd library (#8)
1 parent e394035 commit ec234e5

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ option(LLAMA_BUILD_TOOLS "llama: build tools" ${LLAMA_STANDALONE})
8181
option(LLAMA_BUILD_EXAMPLES "llama: build examples" ${LLAMA_STANDALONE})
8282
option(LLAMA_BUILD_SERVER "llama: build server example" ${LLAMA_STANDALONE})
8383

84+
# specific extras
85+
option(LLAMA_MTMD "llama: multimodal support" OFF)
86+
8487
# 3rd party libs
8588
option(LLAMA_CURL "llama: use libcurl to download model from an URL" ON)
8689
option(LLAMA_LLGUIDANCE "llama-common: include LLGuidance library for structured output in common utils" OFF)
@@ -210,6 +213,10 @@ if (LLAMA_BUILD_COMMON AND LLAMA_BUILD_TOOLS)
210213
add_subdirectory(tools)
211214
endif()
212215

216+
if (LLAMA_MTMD)
217+
add_subdirectory(tools/mtmd)
218+
endif()
219+
213220
#
214221
# install
215222
#
@@ -245,7 +252,7 @@ if (LLAMA_BUILD_COMMON)
245252

246253
endif()
247254

248-
if (LLAMA_BUILD_TOOLS)
255+
if (LLAMA_MTMD)
249256

250257
install(
251258
TARGETS mtmd

tools/mtmd/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ if (TARGET BUILD_INFO)
5050
add_dependencies(mtmd-helper BUILD_INFO)
5151
endif()
5252

53+
if (LLAMA_BUILD_TOOLS)
5354
add_executable(llama-llava-cli deprecation-warning.cpp)
5455
add_executable(llama-gemma3-cli deprecation-warning.cpp)
5556
add_executable(llama-minicpmv-cli deprecation-warning.cpp)
@@ -61,3 +62,4 @@ set_target_properties (${TARGET} PROPERTIES OUTPUT_NAME llama-mtmd-cli)
6162
install (TARGETS ${TARGET} RUNTIME)
6263
target_link_libraries (${TARGET} PRIVATE common mtmd Threads::Threads)
6364
target_compile_features(${TARGET} PRIVATE cxx_std_17)
65+
endif()

0 commit comments

Comments
 (0)