From 34c11a4241efbcaeb246fed34f87882bc5188958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Sat, 27 Sep 2025 08:27:07 +0000 Subject: [PATCH] build : add LLAMA_OPENSSL option (#16285) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce a new `LLAMA_OPENSSL` option, enabled by default. This preserves the previous default (libcurl first, OpenSSL as fallback), while allowing OpenSSL to be disabled if desired. Signed-off-by: Adrien Gallouët --- CMakeLists.txt | 1 + common/CMakeLists.txt | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4720e1f1a2955..7a69d94dd5551 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,6 +92,7 @@ option(LLAMA_TOOLS_INSTALL "llama: install tools" ${LLAMA_TOOLS_INSTALL_ # 3rd party libs option(LLAMA_CURL "llama: use libcurl to download model from an URL" ON) +option(LLAMA_OPENSSL "llama: use openssl to download model from an URL" ON) option(LLAMA_LLGUIDANCE "llama-common: include LLGuidance library for structured output in common utils" OFF) # Required for relocatable CMake package diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index e7c4cc4bdc744..0cf104833c7f1 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -87,7 +87,8 @@ if (LLAMA_CURL) target_compile_definitions(${TARGET} PUBLIC LLAMA_USE_CURL) include_directories(${CURL_INCLUDE_DIRS}) set(LLAMA_COMMON_EXTRA_LIBS ${LLAMA_COMMON_EXTRA_LIBS} ${CURL_LIBRARIES}) -else() + +elseif (LLAMA_OPENSSL) find_package(OpenSSL) if (OpenSSL_FOUND) include(CheckCSourceCompiles)