From 429ed950af285fb0675a7dcfe04e90b884cb4632 Mon Sep 17 00:00:00 2001 From: Henri Vasserman Date: Mon, 12 Jun 2023 20:46:53 +0300 Subject: [PATCH] move CPPHTTPLIB settings inside server Since they aren't configurable and were missing from the Makefile. --- examples/server/CMakeLists.txt | 7 ------- examples/server/server.cpp | 7 +++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/server/CMakeLists.txt b/examples/server/CMakeLists.txt index 1d992501b..07ba76ad3 100644 --- a/examples/server/CMakeLists.txt +++ b/examples/server/CMakeLists.txt @@ -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 - $<$: - CPPHTTPLIB_NO_EXCEPTIONS=1 - > - SERVER_VERBOSE=$ ) target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT}) diff --git a/examples/server/server.cpp b/examples/server/server.cpp index 8c02dd977..2fd64d543 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -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"