move CPPHTTPLIB settings inside server

Since they aren't configurable and were missing from the Makefile.
This commit is contained in:
Henri Vasserman 2023-06-12 20:46:53 +03:00
parent 28694f7ac9
commit 429ed950af
No known key found for this signature in database
GPG key ID: 2995FC0F58B1A986
2 changed files with 7 additions and 7 deletions

View file

@ -3,13 +3,6 @@ option(LLAMA_SERVER_VERBOSE "Build verbose logging option for Server" ON)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(${TARGET} server.cpp json.hpp httplib.h)
target_compile_definitions(${TARGET} PRIVATE
# single thread
CPPHTTPLIB_THREAD_POOL_COUNT=1
# crash the server in debug mode, otherwise send an http 500 error
$<$<CONFIG:Debug>:
CPPHTTPLIB_NO_EXCEPTIONS=1
>
SERVER_VERBOSE=$<BOOL:${LLAMA_SERVER_VERBOSE}>
)
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})

View file

@ -2,6 +2,13 @@
#include "llama.h"
#include "build-info.h"
// single thread
#define CPPHTTPLIB_THREAD_POOL_COUNT 1
#ifndef NDEBUG
// crash the server in debug mode, otherwise send an http 500 error
#define CPPHTTPLIB_NO_EXCEPTIONS 1
#endif
#include "httplib.h"
#include "json.hpp"