@@ -9,6 +9,8 @@ add_library(mtmd
99 clip.cpp
1010 clip.h
1111 clip-impl.h
12+ mtmd-helper.cpp
13+ mtmd-helper.h
1214 )
1315
1416target_link_libraries (mtmd PUBLIC ggml llama)
@@ -23,33 +25,20 @@ if (BUILD_SHARED_LIBS)
2325 target_compile_definitions (mtmd PUBLIC LLAMA_SHARED)
2426endif ()
2527
26- set (MTMD_PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR} /mtmd.h)
28+ set (MTMD_PUBLIC_HEADERS
29+ ${CMAKE_CURRENT_SOURCE_DIR} /mtmd.h
30+ ${CMAKE_CURRENT_SOURCE_DIR} /mtmd-helper.h
31+ )
2732
2833set_target_properties (mtmd
2934 PROPERTIES
3035 PUBLIC_HEADER "${MTMD_PUBLIC_HEADERS} " )
3136
3237install (TARGETS mtmd LIBRARY PUBLIC_HEADER )
3338
34- # compile the helper separately, to avoid long compile times with miniaudio.h and stb_image.h
35-
36- add_library (mtmd-helper STATIC
37- mtmd-helper.cpp
38- mtmd-helper.h
39- )
40-
41- target_link_libraries (mtmd-helper PRIVATE mtmd Threads::Threads)
42- target_include_directories (mtmd-helper PUBLIC .)
43- target_include_directories (mtmd-helper PRIVATE ../..)
44- target_compile_features (mtmd-helper PRIVATE cxx_std_17)
45-
46- if (BUILD_SHARED_LIBS )
47- set_target_properties (mtmd-helper PROPERTIES POSITION_INDEPENDENT_CODE ON )
48- endif ()
49-
5039if (NOT MSVC )
5140 # for stb_image.h and miniaudio.h
52- target_compile_options (mtmd-helper PRIVATE -Wno-cast-qual)
41+ target_compile_options (mtmd PRIVATE -Wno-cast-qual)
5342endif ()
5443
5544if (TARGET BUILD_INFO)
@@ -66,5 +55,5 @@ set(TARGET llama-mtmd-cli)
6655add_executable (${TARGET} mtmd-cli.cpp)
6756set_target_properties (${TARGET} PROPERTIES OUTPUT_NAME llama-mtmd-cli)
6857install (TARGETS ${TARGET} RUNTIME)
69- target_link_libraries (${TARGET} PRIVATE common mtmd mtmd-helper Threads::Threads)
58+ target_link_libraries (${TARGET} PRIVATE common mtmd Threads::Threads)
7059target_compile_features (${TARGET} PRIVATE cxx_std_17)
0 commit comments