File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,27 @@ if(LLVM_ENABLE_LIBXML2)
159
159
set (LLVM_ENABLE_LIBXML2 "${HAVE_LIBXML2} " )
160
160
endif ()
161
161
162
+ if (LLVM_ENABLE_CURL )
163
+ if (LLVM_ENABLE_CURL STREQUAL FORCE_ON )
164
+ find_package (CURL REQUIRED )
165
+ else ()
166
+ find_package (CURL )
167
+ endif ()
168
+ if (CURL_FOUND )
169
+ # Check if curl we found is usable; for example, we may have found a 32-bit
170
+ # library on a 64-bit system which would result in a link-time failure.
171
+ cmake_push_check_state ()
172
+ list (APPEND CMAKE_REQUIRED_INCLUDES ${CURL_INCLUDE_DIRS} )
173
+ list (APPEND CMAKE_REQUIRED_LIBRARIES ${CURL_LIBRARY} )
174
+ check_symbol_exists (curl_easy_init curl/curl.h HAVE_CURL )
175
+ cmake_pop_check_state ()
176
+ if (LLVM_ENABLE_CURL STREQUAL FORCE_ON AND NOT HAVE_CURL )
177
+ message (FATAL_ERROR "Failed to configure curl" )
178
+ endif ()
179
+ endif ()
180
+ set (LLVM_ENABLE_CURL "${HAVE_CURL} " )
181
+ endif ()
182
+
162
183
# Don't look for these libraries if we're using MSan, since uninstrumented third
163
184
# party code may call MSan interceptors like strlen, leading to false positives.
164
185
if (NOT LLVM_USE_SANITIZER MATCHES "Memory.*" )
You can’t perform that action at this time.
0 commit comments