2024-11-26 14:18:08 +02:00
|
|
|
llama_add_compile_flags()
|
|
|
|
|
|
2024-06-26 18:33:02 +03:00
|
|
|
#
|
|
|
|
|
# libraries
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
# llama
|
|
|
|
|
|
2026-04-16 23:25:16 +02:00
|
|
|
file(GLOB LLAMA_MODELS_SOURCES "models/*.cpp")
|
|
|
|
|
|
2024-06-26 18:33:02 +03:00
|
|
|
add_library(llama
|
|
|
|
|
../include/llama.h
|
|
|
|
|
llama.cpp
|
2025-01-03 10:18:53 +02:00
|
|
|
llama-adapter.cpp
|
|
|
|
|
llama-arch.cpp
|
|
|
|
|
llama-batch.cpp
|
|
|
|
|
llama-chat.cpp
|
|
|
|
|
llama-context.cpp
|
2025-05-27 19:08:44 +03:00
|
|
|
llama-cparams.cpp
|
2024-07-23 13:10:17 +03:00
|
|
|
llama-grammar.cpp
|
2025-03-13 12:35:44 +02:00
|
|
|
llama-graph.cpp
|
2025-01-03 10:18:53 +02:00
|
|
|
llama-hparams.cpp
|
|
|
|
|
llama-impl.cpp
|
2025-03-13 12:35:44 +02:00
|
|
|
llama-io.cpp
|
2025-08-21 17:00:33 +03:00
|
|
|
llama-kv-cache.cpp
|
|
|
|
|
llama-kv-cache-iswa.cpp
|
2026-05-29 10:15:17 +02:00
|
|
|
llama-kv-cache-dsa.cpp
|
2025-03-13 12:35:44 +02:00
|
|
|
llama-memory.cpp
|
2025-06-19 00:08:14 -05:00
|
|
|
llama-memory-hybrid.cpp
|
2026-01-21 13:30:23 +01:00
|
|
|
llama-memory-hybrid-iswa.cpp
|
2025-06-19 00:08:14 -05:00
|
|
|
llama-memory-recurrent.cpp
|
2025-01-03 10:18:53 +02:00
|
|
|
llama-mmap.cpp
|
|
|
|
|
llama-model-loader.cpp
|
2025-05-12 14:44:49 +02:00
|
|
|
llama-model-saver.cpp
|
2025-01-03 10:18:53 +02:00
|
|
|
llama-model.cpp
|
|
|
|
|
llama-quant.cpp
|
2026-02-06 07:26:54 +01:00
|
|
|
llama-sampler.cpp
|
2025-01-03 10:18:53 +02:00
|
|
|
llama-vocab.cpp
|
2024-06-26 18:33:02 +03:00
|
|
|
unicode-data.cpp
|
2025-03-13 12:35:44 +02:00
|
|
|
unicode.cpp
|
|
|
|
|
unicode.h
|
2026-04-16 23:25:16 +02:00
|
|
|
${LLAMA_MODELS_SOURCES}
|
2024-06-26 18:33:02 +03:00
|
|
|
)
|
|
|
|
|
|
2025-11-11 04:19:50 -07:00
|
|
|
set_target_properties(llama PROPERTIES
|
|
|
|
|
VERSION ${LLAMA_INSTALL_VERSION}
|
|
|
|
|
SOVERSION 0
|
2025-12-09 06:17:41 -05:00
|
|
|
MACHO_CURRENT_VERSION 0 # keep macOS linker from seeing oversized version number
|
2025-11-11 04:19:50 -07:00
|
|
|
)
|
|
|
|
|
|
2025-04-24 16:00:10 +03:00
|
|
|
target_include_directories(llama PRIVATE .)
|
|
|
|
|
target_include_directories(llama PUBLIC ../include)
|
|
|
|
|
target_compile_features (llama PRIVATE cxx_std_17) # don't bump
|
2024-06-26 18:33:02 +03:00
|
|
|
|
|
|
|
|
target_link_libraries(llama PUBLIC ggml)
|
|
|
|
|
|
|
|
|
|
if (BUILD_SHARED_LIBS)
|
|
|
|
|
set_target_properties(llama PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
2024-11-14 18:04:35 +01:00
|
|
|
target_compile_definitions(llama PRIVATE LLAMA_BUILD)
|
|
|
|
|
target_compile_definitions(llama PUBLIC LLAMA_SHARED)
|
2024-06-26 18:33:02 +03:00
|
|
|
endif()
|