Skip to content

Commit a963705

Browse files
committed
LLAMA_RUN_EXTRA_LIBS
1 parent a8a7ed9 commit a963705

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

examples/run/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
set(TARGET llama-run)
22
add_executable(${TARGET} run.cpp linenoise.cpp/linenoise.cpp)
3+
4+
# TODO: avoid copying this code block from common/CMakeLists.txt
5+
set(LLAMA_RUN_EXTRA_LIBS "")
36
if (LLAMA_CURL)
7+
find_package(CURL REQUIRED)
8+
target_compile_definitions(${TARGET} PUBLIC LLAMA_USE_CURL)
49
include_directories(${CURL_INCLUDE_DIRS})
10+
find_library(CURL_LIBRARY curl REQUIRED)
11+
set(LLAMA_RUN_EXTRA_LIBS ${LLAMA_RUN_EXTRA_LIBS} ${CURL_LIBRARY})
512
endif ()
13+
614
install(TARGETS ${TARGET} RUNTIME)
7-
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
15+
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT} ${LLAMA_RUN_EXTRA_LIBS})
816
target_compile_features(${TARGET} PRIVATE cxx_std_17)

0 commit comments

Comments
 (0)