Skip to content

Commit 6fe2be6

Browse files
authored
try before
1 parent bd3f7fa commit 6fe2be6

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

vendor/cpp-httplib/CMakeLists.txt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
3348
set(OPENSSL_NO_ASM ON CACHE BOOL "Disable OpenSSL ASM code when building BoringSSL or LibreSSL")
3449

3550
if (LLAMA_BUILD_BORINGSSL)
@@ -148,21 +163,6 @@ elseif (LLAMA_OPENSSL)
148163
endif()
149164
endif()
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-
166166
if (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

Comments
 (0)