Skip to content

Commit d961fab

Browse files
authored
Merge pull request #19 from jpgaribotti/QVAC-6114
QVAC-6114: Fix CMakeLists to support building with LLAMA_MTMD on or off
2 parents 646fdc5 + c88d653 commit d961fab

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,8 @@ endif()
213213

214214
if (LLAMA_BUILD_COMMON AND LLAMA_BUILD_TOOLS)
215215
add_subdirectory(tools)
216-
endif()
217-
218-
if (LLAMA_MTMD)
219-
add_subdirectory(tools/mtmd)
216+
elseif (LLAMA_MTMD)
217+
add_subdirectory(tools/mtmd)
220218
endif()
221219

222220
#

tests/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,11 @@ if (NOT GGML_BACKEND_DL)
214214
endif()
215215

216216
# libmtmd
217-
set(LLAMA_TEST_NAME test-mtmd-c-api)
218-
llama_build_and_test(test-mtmd-c-api.c)
219-
target_link_libraries(${LLAMA_TEST_NAME} PRIVATE mtmd)
217+
if (LLAMA_MTMD)
218+
set(LLAMA_TEST_NAME test-mtmd-c-api)
219+
llama_build_and_test(test-mtmd-c-api.c)
220+
target_link_libraries(${LLAMA_TEST_NAME} PRIVATE mtmd)
221+
endif()
220222

221223
# dummy executable - not installed
222224
get_filename_component(TEST_TARGET test-c.c NAME_WE)

tools/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ else()
2121
add_subdirectory(main)
2222
add_subdirectory(perplexity)
2323
add_subdirectory(quantize)
24-
if (LLAMA_BUILD_SERVER)
24+
if (LLAMA_BUILD_SERVER AND LLAMA_MTMD)
2525
add_subdirectory(server)
2626
endif()
2727
add_subdirectory(run)
2828
add_subdirectory(tokenize)
2929
add_subdirectory(tts)
30-
add_subdirectory(mtmd)
30+
if (LLAMA_MTMD)
31+
add_subdirectory(mtmd)
32+
endif()
3133
if (GGML_RPC)
3234
add_subdirectory(rpc)
3335
endif()

0 commit comments

Comments
 (0)