Skip to content

Commit f218f1d

Browse files
committed
Add option to build only mtmd library (#8)
1 parent 45f6198 commit f218f1d

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
@@ -83,6 +83,9 @@ option(LLAMA_BUILD_TOOLS "llama: build tools" ${LLAMA_STANDALONE})
8383
option(LLAMA_BUILD_EXAMPLES "llama: build examples" ${LLAMA_STANDALONE})
8484
option(LLAMA_BUILD_SERVER "llama: build server example" ${LLAMA_STANDALONE})
8585

86+
# specific extras
87+
option(LLAMA_MTMD "llama: multimodal support" OFF)
88+
8689
# 3rd party libs
8790
option(LLAMA_CURL "llama: use libcurl to download model from an URL" ON)
8891
option(LLAMA_LLGUIDANCE "llama-common: include LLGuidance library for structured output in common utils" OFF)
@@ -212,6 +215,10 @@ if (LLAMA_BUILD_COMMON AND LLAMA_BUILD_TOOLS)
212215
add_subdirectory(tools)
213216
endif()
214217

218+
if (LLAMA_MTMD)
219+
add_subdirectory(tools/mtmd)
220+
endif()
221+
215222
#
216223
# install
217224
#
@@ -247,7 +254,7 @@ if (LLAMA_BUILD_COMMON)
247254

248255
endif()
249256

250-
if (LLAMA_BUILD_TOOLS)
257+
if (LLAMA_MTMD)
251258

252259
install(
253260
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)
@@ -63,3 +64,4 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL "iOS")
6364
endif()
6465
target_link_libraries (${TARGET} PRIVATE common mtmd Threads::Threads)
6566
target_compile_features(${TARGET} PRIVATE cxx_std_17)
67+
endif()

0 commit comments

Comments
 (0)