From 7a853dc56d71fba64172f811e9e27a917922a832 Mon Sep 17 00:00:00 2001 From: anon Date: Tue, 30 May 2023 21:39:30 -0300 Subject: [PATCH] prevent the server from swallowing exceptions in debug mode So it's easier to catch them inside a debugger. --- examples/server/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/server/CMakeLists.txt b/examples/server/CMakeLists.txt index bd65c84b1..b38fa864a 100644 --- a/examples/server/CMakeLists.txt +++ b/examples/server/CMakeLists.txt @@ -1,6 +1,11 @@ set(TARGET server) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) add_executable(${TARGET} server.cpp json.hpp httplib.h) +target_compile_definitions(${TARGET} PRIVATE + $<$: + CPPHTTPLIB_NO_EXCEPTIONS=1 + > +) target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT}) target_compile_features(${TARGET} PRIVATE cxx_std_11) if(TARGET BUILD_INFO)