Skip to content

Commit 09edb7e

Browse files
committed
get libllava to output in the right place
1 parent 708928c commit 09edb7e

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

llava/CMakeLists.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
11
set(TARGET llava)
22

3-
add_library(${TARGET} llava.cpp llava.h clip.cpp clip.h)
3+
if (BUILD_SHARED_LIBS)
4+
add_library(${TARGET} SHARED llava.cpp llava.h clip.cpp clip.h)
5+
set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON)
6+
set_target_properties(${TARGET} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
7+
target_link_libraries(${TARGET} PUBLIC Threads::Threads common llama ggml ${LLAMA_EXTRA_LIBS})
8+
install(TARGETS ${TARGET} LIBRARY)
9+
else()
10+
add_library(${TARGET} llava.cpp llava.h clip.cpp clip.h)
11+
target_link_libraries(${TARGET} PRIVATE common llama ggml ${CMAKE_THREAD_LIBS_INIT})
12+
endif()
413

514
target_include_directories(${TARGET} PUBLIC .)
6-
target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
15+
target_include_directories(${TARGET} PUBLIC ..)
16+
target_include_directories(${TARGET} PUBLIC ../common)
17+
718
target_compile_features(${TARGET} PRIVATE cxx_std_11)
819
if (NOT MSVC)
920
target_compile_options(${TARGET} PRIVATE -Wno-cast-qual) # stb_image.h
1021
endif()
1122
if(TARGET BUILD_INFO)
1223
add_dependencies(${TARGET} BUILD_INFO)
1324
endif()
25+

0 commit comments

Comments
 (0)