From 2201ddb759466ba1f12c1e18562cec462685001f Mon Sep 17 00:00:00 2001 From: Concedo <39025047+LostRuins@users.noreply.github.com> Date: Tue, 30 Sep 2025 16:29:11 +0800 Subject: [PATCH] fix tool builds --- common/arg.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/common/arg.cpp b/common/arg.cpp index aa4b1e21b..a28a5261a 100644 --- a/common/arg.cpp +++ b/common/arg.cpp @@ -39,7 +39,7 @@ #if defined(LLAMA_USE_CURL) #include #include -#else +#elif defined(LLAMA_USE_HTTPLIB) #include #endif @@ -572,6 +572,8 @@ std::pair> common_remote_get_content(const std::string & #else +#ifdef LLAMA_USE_HTTPLIB + bool common_has_curl() { return false; } @@ -936,6 +938,26 @@ std::pair> common_remote_get_content(const std::string return { res->status, std::move(buf) }; } +#else //no httplib + +bool common_has_curl() { + return false; +} + +static bool common_download_file_single_online(const std::string &, const std::string &, const std::string &) { + LOG_ERR("error: built without CURL, cannot download model from internet\n"); + return false; +} + +std::pair> common_remote_get_content(const std::string & url, const common_remote_params &) { + if (!url.empty()) { + throw std::runtime_error("error: built without CURL, cannot download model from the internet"); + } + + return {}; +} +#endif + #endif // LLAMA_USE_CURL static bool common_download_file_single(const std::string & url,