File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -129,10 +129,22 @@ if(NOT TARGET ggml::ggml)
129129 string (REPLACE "-" "_" _ggml_backend_pfx "${_ggml_backend} " )
130130 string (TOUPPER "${_ggml_backend_pfx} " _ggml_backend_pfx)
131131
132- find_library (${_ggml_backend_pfx} _LIBRARY ${_ggml_backend}
133- REQUIRED
134- HINTS ${GGML_BACKEND_DIR} ${GGML_LIB_DIR}
135- NO_CMAKE_FIND_ROOT_PATH )
132+ if (GGML_BACKEND_DL)
133+ # On systems with dynamically loaded backends, it's OK if not all are installed
134+ find_library (${_ggml_backend_pfx} _LIBRARY ${_ggml_backend}
135+ HINTS ${GGML_BACKEND_DIR} ${GGML_LIB_DIR}
136+ NO_CMAKE_FIND_ROOT_PATH )
137+
138+ if (NOT ${_ggml_backend_pfx} _LIBRARY)
139+ message (DEBUG "Built backend ${${_ggml_backend_pfx} _LIBRARY} not found" )
140+ continue ()
141+ endif ()
142+ else ()
143+ find_library (${_ggml_backend_pfx} _LIBRARY ${_ggml_backend}
144+ REQUIRED
145+ HINTS ${GGML_LIB_DIR}
146+ NO_CMAKE_FIND_ROOT_PATH )
147+ endif ()
136148
137149 message (STATUS "Found ${${_ggml_backend_pfx} _LIBRARY}" )
138150
You can’t perform that action at this time.
0 commit comments