← Commit list

97f518e193

Joshua Vandaële
Joshua Vandaële
2026-01-09
SUCCESS Duration: 341s

Subject

cmake: reference OpenSSL and ZLIB imported targets only when enabled

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

CMakeLists.txt+8 -1
@@ -1799,7 +1799,14 @@ endif()
# before dependencies detected via curl's custom Find modules, and breaks
# linkers sensitive to lib order. There must be a better solution to this.
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
- foreach(_lib IN ITEMS OpenSSL::Crypto ZLIB::ZLIB)
+ set(_libs "")
+ if(USE_OPENSSL)
+ list(APPEND _libs OpenSSL::Crypto)
+ endif()
+ if(HAVE_LIBZ)
+ list(APPEND _libs ZLIB::ZLIB)
+ endif()
+ foreach(_lib IN LISTS _libs)
if(TARGET "${_lib}")
add_library(CURL::${_lib} INTERFACE IMPORTED)
get_target_property(_libname "${_lib}" LOCATION)