Skip to content

Commit 65b0519

Browse files
author
git apple-llvm automerger
committed
Merge commit '2de43d4202a3' from llvm.org/main into next
2 parents 5668398 + 2de43d4 commit 65b0519

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

llvm/cmake/config-ix.cmake

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,27 @@ if(LLVM_ENABLE_LIBXML2)
159159
set(LLVM_ENABLE_LIBXML2 "${HAVE_LIBXML2}")
160160
endif()
161161

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+
162183
# Don't look for these libraries if we're using MSan, since uninstrumented third
163184
# party code may call MSan interceptors like strlen, leading to false positives.
164185
if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*")

0 commit comments

Comments
 (0)