find_package(Threads REQUIRED)
+llama_add_compile_flags()
+
add_library(${TARGET} STATIC httplib.cpp httplib.h)
-if (NOT MSVC)
- # disable warnings in 3rd party code
+
+# disable warnings in 3rd party code
+if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+ target_compile_options(${TARGET} PRIVATE /w)
+else()
target_compile_options(${TARGET} PRIVATE -w)
endif()
endif()
endif()
+# disable warnings in 3rd party code
+if(LLAMA_BUILD_BORINGSSL OR LLAMA_BUILD_LIBRESSL)
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+ target_compile_options(ssl PRIVATE /w)
+ target_compile_options(crypto PRIVATE /w)
+ if(LLAMA_BUILD_BORINGSSL)
+ target_compile_options(fipsmodule PRIVATE /w)
+ endif()
+ else()
+ target_compile_options(ssl PRIVATE -w)
+ target_compile_options(crypto PRIVATE -w)
+ if(LLAMA_BUILD_BORINGSSL)
+ target_compile_options(fipsmodule PRIVATE -w)
+ endif()
+ endif()
+endif()
+
if (CPPHTTPLIB_OPENSSL_SUPPORT)
target_compile_definitions(${TARGET} PUBLIC CPPHTTPLIB_OPENSSL_SUPPORT) # used in server.cpp
if (APPLE AND CMAKE_SYSTEM_NAME STREQUAL "Darwin")