Skip to content

Commit 11fb327

Browse files
authored
vendor : add missing llama_add_compile_flags (ggml-org#19322)
* add missing llama_add_compile_flags * disable all warnings for ssl, crypto and fipsmodule
1 parent e6e934c commit 11fb327

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

vendor/cpp-httplib/CMakeLists.txt

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ license_add_file("cpp-httplib" "LICENSE")
33

44
find_package(Threads REQUIRED)
55

6+
llama_add_compile_flags()
7+
68
add_library(${TARGET} STATIC httplib.cpp httplib.h)
7-
if (NOT MSVC)
8-
# disable warnings in 3rd party code
9+
10+
# disable warnings in 3rd party code
11+
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
12+
target_compile_options(${TARGET} PRIVATE /w)
13+
else()
914
target_compile_options(${TARGET} PRIVATE -w)
1015
endif()
1116

@@ -146,6 +151,23 @@ elseif (LLAMA_OPENSSL)
146151
endif()
147152
endif()
148153

154+
# disable warnings in 3rd party code
155+
if(LLAMA_BUILD_BORINGSSL OR LLAMA_BUILD_LIBRESSL)
156+
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
157+
target_compile_options(ssl PRIVATE /w)
158+
target_compile_options(crypto PRIVATE /w)
159+
if(LLAMA_BUILD_BORINGSSL)
160+
target_compile_options(fipsmodule PRIVATE /w)
161+
endif()
162+
else()
163+
target_compile_options(ssl PRIVATE -w)
164+
target_compile_options(crypto PRIVATE -w)
165+
if(LLAMA_BUILD_BORINGSSL)
166+
target_compile_options(fipsmodule PRIVATE -w)
167+
endif()
168+
endif()
169+
endif()
170+
149171
if (CPPHTTPLIB_OPENSSL_SUPPORT)
150172
target_compile_definitions(${TARGET} PUBLIC CPPHTTPLIB_OPENSSL_SUPPORT) # used in server.cpp
151173
if (APPLE AND CMAKE_SYSTEM_NAME STREQUAL "Darwin")

0 commit comments

Comments
 (0)