Skip to content

Commit 97bbca6

Browse files
cmake : fix ld warning duplicate libraries libllama.a (#4671)
* fix "ld: warning: ignoring duplicate libraries: '../libllama.a'" * fix warning in example.
1 parent 4af4801 commit 97bbca6

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

common/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ endif()
6565

6666
target_include_directories(${TARGET} PUBLIC .)
6767
target_compile_features(${TARGET} PUBLIC cxx_std_11)
68-
target_link_libraries(${TARGET} PRIVATE llama build_info)
68+
target_link_libraries(${TARGET} PRIVATE build_info PUBLIC llama)

examples/llava/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ endif()
3232
set(TARGET llava-cli)
3333
add_executable(llava-cli llava-cli.cpp)
3434
install(TARGETS llava-cli RUNTIME)
35-
target_link_libraries(llava-cli PRIVATE common llama llava ${CMAKE_THREAD_LIBS_INIT})
35+
target_link_libraries(llava-cli PRIVATE common llava ${CMAKE_THREAD_LIBS_INIT})
3636
target_compile_features(llava PRIVATE cxx_std_11)

examples/server/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ install(TARGETS ${TARGET} RUNTIME)
66
target_compile_definitions(${TARGET} PRIVATE
77
SERVER_VERBOSE=$<BOOL:${LLAMA_SERVER_VERBOSE}>
88
)
9-
target_link_libraries(${TARGET} PRIVATE common llama llava ${CMAKE_THREAD_LIBS_INIT})
9+
target_link_libraries(${TARGET} PRIVATE common llava ${CMAKE_THREAD_LIBS_INIT})
1010
if (WIN32)
1111
TARGET_LINK_LIBRARIES(${TARGET} PRIVATE ws2_32)
1212
endif()

tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ function(llama_build_executable source)
22
get_filename_component(TEST_TARGET ${source} NAME_WE)
33
add_executable(${TEST_TARGET} ${source})
44
install(TARGETS ${TEST_TARGET} RUNTIME)
5-
target_link_libraries(${TEST_TARGET} PRIVATE llama common)
5+
target_link_libraries(${TEST_TARGET} PRIVATE common)
66
endfunction()
77

88
function(llama_test_executable name source)
@@ -14,7 +14,7 @@ function(llama_build_and_test_executable source)
1414
get_filename_component(TEST_TARGET ${source} NAME_WE)
1515
add_executable(${TEST_TARGET} ${source})
1616
install(TARGETS ${TEST_TARGET} RUNTIME)
17-
target_link_libraries(${TEST_TARGET} PRIVATE llama common)
17+
target_link_libraries(${TEST_TARGET} PRIVATE common)
1818
add_test(NAME ${TEST_TARGET} COMMAND $<TARGET_FILE:${TEST_TARGET}> ${ARGN})
1919
endfunction()
2020

0 commit comments

Comments
 (0)