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"