diff --git a/tools/run/CMakeLists.txt b/tools/run/CMakeLists.txt index 6ad7534e290..1d2108805c4 100644 --- a/tools/run/CMakeLists.txt +++ b/tools/run/CMakeLists.txt @@ -4,10 +4,15 @@ add_executable(${TARGET} run.cpp linenoise.cpp/linenoise.cpp) # TODO: avoid copying this code block from common/CMakeLists.txt set(LLAMA_RUN_EXTRA_LIBS "") if (LLAMA_CURL) - find_package(CURL REQUIRED) - target_compile_definitions(${TARGET} PUBLIC LLAMA_USE_CURL) - include_directories(${CURL_INCLUDE_DIRS}) - set(LLAMA_RUN_EXTRA_LIBS ${LLAMA_RUN_EXTRA_LIBS} ${CURL_LIBRARIES}) + find_package(CURL) + if (NOT CURL_FOUND) + message(WARNING "Could NOT find CURL. Falling back to cpp-httplib. Hint: to explicitly disable CURL, set -DLLAMA_CURL=OFF") + set(LLAMA_CURL OFF) + else() + target_compile_definitions(${TARGET} PUBLIC LLAMA_USE_CURL) + include_directories(${CURL_INCLUDE_DIRS}) + set(LLAMA_RUN_EXTRA_LIBS ${LLAMA_RUN_EXTRA_LIBS} ${CURL_LIBRARIES}) + endif() endif () if(LLAMA_TOOLS_INSTALL)