mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-11-15 15:29:53 +00:00
a71d81cf8c
* server : simple chat UI with vuejs and daisyui * move old files to legacy folder * embed deps into binary * basic markdown support * add conversation history, save to localStorage * fix bg-base classes * save theme preferences * fix tests * regenerate, edit, copy buttons * small fixes * docs: how to use legacy ui * better error handling * make CORS preflight more explicit * add GET method for CORS * fix tests * clean up a bit * better auto scroll * small fixes * use collapse-arrow * fix closeAndSaveConfigDialog * small fix * remove console.log * fix style for <pre> element * lighter bubble color (less distract when reading)
54 lines
1.4 KiB
CMake
54 lines
1.4 KiB
CMake
set(TARGET llama-server)
|
|
|
|
option(LLAMA_SERVER_SSL "Build SSL support for the server" OFF)
|
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
if (MINGW)
|
|
# fix: https://github.com/ggerganov/llama.cpp/actions/runs/9651004652/job/26617901362?pr=8006
|
|
add_compile_definitions(_WIN32_WINNT=${GGML_WIN_VER})
|
|
endif()
|
|
|
|
set(TARGET_SRCS
|
|
server.cpp
|
|
utils.hpp
|
|
httplib.h
|
|
)
|
|
set(PUBLIC_ASSETS
|
|
index.html
|
|
completion.js
|
|
loading.html
|
|
deps_daisyui.min.css
|
|
deps_markdown-it.js
|
|
deps_tailwindcss.js
|
|
deps_vue.esm-browser.js
|
|
)
|
|
|
|
foreach(asset ${PUBLIC_ASSETS})
|
|
set(input "${CMAKE_CURRENT_SOURCE_DIR}/public/${asset}")
|
|
set(output "${CMAKE_CURRENT_BINARY_DIR}/${asset}.hpp")
|
|
list(APPEND TARGET_SRCS ${output})
|
|
add_custom_command(
|
|
DEPENDS "${input}"
|
|
OUTPUT "${output}"
|
|
COMMAND "${CMAKE_COMMAND}" "-DINPUT=${input}" "-DOUTPUT=${output}" -P "${PROJECT_SOURCE_DIR}/scripts/xxd.cmake"
|
|
)
|
|
endforeach()
|
|
|
|
add_executable(${TARGET} ${TARGET_SRCS})
|
|
install(TARGETS ${TARGET} RUNTIME)
|
|
|
|
target_link_libraries(${TARGET} PRIVATE common ${CMAKE_THREAD_LIBS_INIT})
|
|
|
|
if (LLAMA_SERVER_SSL)
|
|
find_package(OpenSSL REQUIRED)
|
|
target_link_libraries(${TARGET} PRIVATE OpenSSL::SSL OpenSSL::Crypto)
|
|
target_compile_definitions(${TARGET} PRIVATE CPPHTTPLIB_OPENSSL_SUPPORT)
|
|
endif()
|
|
|
|
if (WIN32)
|
|
TARGET_LINK_LIBRARIES(${TARGET} PRIVATE ws2_32)
|
|
endif()
|
|
|
|
target_compile_features(${TARGET} PRIVATE cxx_std_11)
|