Skip to content

Commit 2201ddb

Browse files
committed
fix tool builds
1 parent 9e4c29f commit 2201ddb

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

common/arg.cpp

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#if defined(LLAMA_USE_CURL)
4040
#include <curl/curl.h>
4141
#include <curl/easy.h>
42-
#else
42+
#elif defined(LLAMA_USE_HTTPLIB)
4343
#include <cpp-httplib/httplib.h>
4444
#endif
4545

@@ -572,6 +572,8 @@ std::pair<long, std::vector<char>> common_remote_get_content(const std::string &
572572

573573
#else
574574

575+
#ifdef LLAMA_USE_HTTPLIB
576+
575577
bool common_has_curl() {
576578
return false;
577579
}
@@ -936,6 +938,26 @@ std::pair<long, std::vector<char>> common_remote_get_content(const std::string
936938
return { res->status, std::move(buf) };
937939
}
938940

941+
#else //no httplib
942+
943+
bool common_has_curl() {
944+
return false;
945+
}
946+
947+
static bool common_download_file_single_online(const std::string &, const std::string &, const std::string &) {
948+
LOG_ERR("error: built without CURL, cannot download model from internet\n");
949+
return false;
950+
}
951+
952+
std::pair<long, std::vector<char>> common_remote_get_content(const std::string & url, const common_remote_params &) {
953+
if (!url.empty()) {
954+
throw std::runtime_error("error: built without CURL, cannot download model from the internet");
955+
}
956+
957+
return {};
958+
}
959+
#endif
960+
939961
#endif // LLAMA_USE_CURL
940962

941963
static bool common_download_file_single(const std::string & url,

0 commit comments

Comments
 (0)