mtmd: explicitly forbidden inclusion of private header and libcommon (#17946)
This commit is contained in:
parent
12280ae905
commit
17158965ac
|
|
@ -53,6 +53,15 @@ if (TARGET BUILD_INFO)
|
||||||
add_dependencies(mtmd-helper BUILD_INFO)
|
add_dependencies(mtmd-helper BUILD_INFO)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# if mtmd is linked against common, we throw an error
|
||||||
|
if (TARGET mtmd)
|
||||||
|
get_target_property(libs mtmd LINK_LIBRARIES)
|
||||||
|
if (libs AND "common" IN_LIST libs)
|
||||||
|
message(FATAL_ERROR "mtmd is designed to be a public library.\n"
|
||||||
|
"It must not link against common")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
add_executable(llama-llava-cli deprecation-warning.cpp)
|
add_executable(llama-llava-cli deprecation-warning.cpp)
|
||||||
add_executable(llama-gemma3-cli deprecation-warning.cpp)
|
add_executable(llama-gemma3-cli deprecation-warning.cpp)
|
||||||
add_executable(llama-minicpmv-cli deprecation-warning.cpp)
|
add_executable(llama-minicpmv-cli deprecation-warning.cpp)
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@
|
||||||
|
|
||||||
// Internal header for clip.cpp
|
// Internal header for clip.cpp
|
||||||
|
|
||||||
|
#define MTMD_INTERNAL_HEADER
|
||||||
|
|
||||||
#define KEY_FTYPE "general.file_type"
|
#define KEY_FTYPE "general.file_type"
|
||||||
#define KEY_NAME "general.name"
|
#define KEY_NAME "general.name"
|
||||||
#define KEY_DESCRIPTION "general.description"
|
#define KEY_DESCRIPTION "general.description"
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
// !!! Internal header, to be used by mtmd only !!!
|
// !!! Internal header, to be used by mtmd only !!!
|
||||||
|
|
||||||
|
#define MTMD_INTERNAL_HEADER
|
||||||
|
|
||||||
struct clip_ctx;
|
struct clip_ctx;
|
||||||
|
|
||||||
struct clip_image_size {
|
struct clip_image_size {
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#define MTMD_INTERNAL_HEADER
|
||||||
|
|
||||||
#define WHISPER_ASSERT GGML_ASSERT
|
#define WHISPER_ASSERT GGML_ASSERT
|
||||||
|
|
||||||
#define WHISPER_SAMPLE_RATE 16000
|
#define WHISPER_SAMPLE_RATE 16000
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,10 @@
|
||||||
#define STB_IMAGE_IMPLEMENTATION
|
#define STB_IMAGE_IMPLEMENTATION
|
||||||
#include "stb/stb_image.h"
|
#include "stb/stb_image.h"
|
||||||
|
|
||||||
|
#ifdef MTMD_INTERNAL_HEADER
|
||||||
|
#error "mtmd-helper is a public library outside of mtmd. it must not include internal headers"
|
||||||
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// internal logging functions
|
// internal logging functions
|
||||||
//
|
//
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue