@@ -30,6 +30,21 @@ target_compile_definitions(${TARGET} PRIVATE
3030 CPPHTTPLIB_TCP_NODELAY=1
3131)
3232
33+ if (LLAMA_FATAL_WARNINGS)
34+ # disable fatal warnings in 3rd party code
35+ if (MSVC )
36+ get_target_property (target_options ${TARGET} COMPILE_OPTIONS )
37+ list (REMOVE_ITEM target_options "/WX" )
38+ message (STATUS "Target options: ${target_options} " )
39+ set_target_properties (${TARGET} PROPERTIES COMPILE_OPTIONS "${target_options} " )
40+ else ()
41+ get_target_property (target_options ${TARGET} COMPILE_OPTIONS )
42+ string (REPLACE "-Werror;" "" target_options "${target_options} " )
43+ message (STATUS "Target options: ${target_options} " )
44+ set_target_properties (${TARGET} PROPERTIES COMPILE_OPTIONS "${target_options} " )
45+ endif ()
46+ endif ()
47+
3348set (OPENSSL_NO_ASM ON CACHE BOOL "Disable OpenSSL ASM code when building BoringSSL or LibreSSL" )
3449
3550if (LLAMA_BUILD_BORINGSSL)
@@ -148,21 +163,6 @@ elseif (LLAMA_OPENSSL)
148163 endif ()
149164endif ()
150165
151- if ((LLAMA_BUILD_BORINGSSL OR LLAMA_BUILD_LIBRESSL) AND LLAMA_FATAL_WARNINGS)
152- # disable fatal warnings in 3rd party code
153- if (MSVC )
154- get_target_property (target_options crypto COMPILE_OPTIONS )
155- list (REMOVE_ITEM target_options "/WX" )
156- message (STATUS "Target options: ${target_options} " )
157- set_target_properties (crypto PROPERTIES COMPILE_OPTIONS "${target_options} " )
158- else ()
159- get_target_property (target_options crypto COMPILE_OPTIONS )
160- string (REPLACE "-Werror;" "" target_options "${target_options} " )
161- message (STATUS "Target options: ${target_options} " )
162- set_target_properties (crypto PROPERTIES COMPILE_OPTIONS "${target_options} " )
163- endif ()
164- endif ()
165-
166166if (CPPHTTPLIB_OPENSSL_SUPPORT)
167167 target_compile_definitions (${TARGET} PUBLIC CPPHTTPLIB_OPENSSL_SUPPORT ) # used in server.cpp
168168 if (APPLE AND CMAKE_SYSTEM_NAME STREQUAL "Darwin" )
0 commit comments