File tree Expand file tree Collapse file tree 2 files changed +19
-10
lines changed Expand file tree Collapse file tree 2 files changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -698,6 +698,7 @@ target_include_directories(llama PUBLIC .)
698698target_compile_features (llama PUBLIC cxx_std_11) # don't bump
699699target_link_libraries (llama PRIVATE
700700 ggml
701+ llava
701702 ${LLAMA_EXTRA_LIBS}
702703 )
703704
@@ -707,6 +708,22 @@ if (BUILD_SHARED_LIBS)
707708 if (LLAMA_METAL)
708709 set_target_properties (llama PROPERTIES RESOURCE "${CMAKE_CURRENT_SOURCE_DIR} /ggml-metal.metal" )
709710 endif ()
711+
712+ # By default, symbols provided by the sublibs that are not used by mainlib (which is all of them in this case)
713+ # are not used. This changes that.
714+ if (WIN32 )
715+ set_target_properties (llama PROPERTIES
716+ LINK_FLAGS "/WHOLEARCHIVE"
717+ )
718+ elseif (APPLE )
719+ set_target_properties (llama PROPERTIES
720+ LINK_FLAGS "-Wl,-all_load"
721+ )
722+ else ()
723+ set_target_properties (llama PROPERTIES
724+ LINK_FLAGS "-Wl,--whole-archive"
725+ )
726+ endif ()
710727endif ()
711728
712729
Original file line number Diff line number Diff line change 11set (TARGET llava)
22
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 ()
3+ add_library (${TARGET} STATIC llava.cpp llava.h clip.cpp clip.h)
4+ target_link_libraries (${TARGET} PRIVATE ${CMAKE_THREAD_LIBS_INIT} )
135
146target_include_directories (${TARGET} PUBLIC .)
157target_include_directories (${TARGET} PUBLIC ..)
You can’t perform that action at this time.
0 commit comments