Peter commited on
Commit
ce83587
·
unverified ·
1 Parent(s): 3d457ce

whisper : add option to use system-installed GGML (#2887)

Browse files
Files changed (1) hide show
  1. CMakeLists.txt +11 -2
CMakeLists.txt CHANGED
@@ -62,7 +62,8 @@ option(WHISPER_ALL_WARNINGS "whisper: enable all compiler warnings"
62
  option(WHISPER_ALL_WARNINGS_3RD_PARTY "whisper: enable all compiler warnings in 3rd party libs" OFF)
63
 
64
  # build
65
- option(WHISPER_FATAL_WARNINGS "whisper: enable -Werror flag" OFF)
 
66
 
67
  # sanitizers
68
  option(WHISPER_SANITIZE_THREAD "whisper: enable thread sanitizer" OFF)
@@ -121,7 +122,15 @@ whisper_option_depr(WARNING WHISPER_SYCL_F16 GGML_SYCL_F16)
121
  #
122
 
123
  if (NOT TARGET ggml)
124
- add_subdirectory(ggml)
 
 
 
 
 
 
 
 
125
  # ... otherwise assume ggml is added by a parent CMakeLists.txt
126
  endif()
127
  add_subdirectory(src)
 
62
  option(WHISPER_ALL_WARNINGS_3RD_PARTY "whisper: enable all compiler warnings in 3rd party libs" OFF)
63
 
64
  # build
65
+ option(WHISPER_FATAL_WARNINGS "whisper: enable -Werror flag" OFF)
66
+ option(WHISPER_USE_SYSTEM_GGML "whisper: use system-installed GGML library" OFF)
67
 
68
  # sanitizers
69
  option(WHISPER_SANITIZE_THREAD "whisper: enable thread sanitizer" OFF)
 
122
  #
123
 
124
  if (NOT TARGET ggml)
125
+ if (WHISPER_USE_SYSTEM_GGML)
126
+ find_package(ggml REQUIRED)
127
+ if (NOT ggml_FOUND)
128
+ message(FATAL_ERROR "System-installed GGML library not found.")
129
+ endif()
130
+ add_library(ggml ALIAS ggml::ggml)
131
+ else()
132
+ add_subdirectory(ggml)
133
+ endif()
134
  # ... otherwise assume ggml is added by a parent CMakeLists.txt
135
  endif()
136
  add_subdirectory(src)