File tree Expand file tree Collapse file tree 6 files changed +49
-1
lines changed Expand file tree Collapse file tree 6 files changed +49
-1
lines changed Original file line number Diff line number Diff line change 2121 add_subdirectory (main)
2222 add_subdirectory (perplexity)
2323 add_subdirectory (quantize)
24+ add_subdirectory (server-core)
2425 if (LLAMA_BUILD_SERVER)
2526 add_subdirectory (server)
2627 endif ()
Original file line number Diff line number Diff line change 1+ # serve
2+
3+ set (TARGET server-core)
4+
5+ add_library (${TARGET}
6+ server-core.cpp
7+ server-utils.hpp
8+ )
9+
10+ target_include_directories (${TARGET} PUBLIC .)
11+ target_include_directories (${TARGET} PRIVATE ${CMAKE_SOURCE_DIR} )
12+
13+ target_link_libraries (${TARGET} PRIVATE common mtmd)
14+
15+ target_compile_features (${TARGET} PRIVATE cxx_std_17)
16+
17+ if (BUILD_SHARED_LIBS )
18+ set_target_properties (${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON )
19+ target_compile_definitions (${TARGET} PRIVATE LLAMA_BUILD)
20+ target_compile_definitions (${TARGET} PUBLIC LLAMA_SHARED)
21+ endif ()
22+
23+ set (serve_PUBLIC_HEADERS
24+ ${CMAKE_CURRENT_SOURCE_DIR} /server-core.h
25+ ${CMAKE_CURRENT_SOURCE_DIR} /server-core.hpp
26+ ${CMAKE_CURRENT_SOURCE_DIR} /server-utils.hpp
27+ )
28+
29+ set_target_properties (${TARGET}
30+ PROPERTIES
31+ PUBLIC_HEADER "${serve_PUBLIC_HEADERS} " )
32+
33+ install (TARGETS ${TARGET} LIBRARY PUBLIC_HEADER )
34+
35+ if (TARGET BUILD_INFO)
36+ add_dependencies (${TARGET} BUILD_INFO)
37+ endif ()
Original file line number Diff line number Diff line change 1+ # LLaMA.cpp Server core
2+
3+ Core of abstract server API for ** llama.cpp** .
Original file line number Diff line number Diff line change 1+ #include " server-core.h"
2+
3+ // placeholder, some implementation can be moved here
Original file line number Diff line number Diff line change 1+ #pragma once
2+
3+ // placeholder, extern API to appear here
Original file line number Diff line number Diff line change @@ -34,8 +34,9 @@ add_executable(${TARGET} ${TARGET_SRCS})
3434install (TARGETS ${TARGET} RUNTIME)
3535
3636target_include_directories (${TARGET} PRIVATE ../llava)
37+ target_include_directories (${TARGET} PRIVATE ../server-core)
3738target_include_directories (${TARGET} PRIVATE ${CMAKE_SOURCE_DIR} )
38- target_link_libraries (${TARGET} PRIVATE common mtmd ${CMAKE_THREAD_LIBS_INIT} )
39+ target_link_libraries (${TARGET} PRIVATE server-core common mtmd ${CMAKE_THREAD_LIBS_INIT} )
3940
4041if (LLAMA_SERVER_SSL)
4142 find_package (OpenSSL REQUIRED)
You can’t perform that action at this time.
0 commit comments