@@ -164,7 +164,7 @@ fn main() {
164164
165165 config
166166 . profile ( "Release" )
167- . define ( "BUILD_SHARED_LIBS" , "OFF " )
167+ . define ( "BUILD_SHARED_LIBS" , "ON " )
168168 . define ( "WHISPER_ALL_WARNINGS" , "OFF" )
169169 . define ( "WHISPER_ALL_WARNINGS_3RD_PARTY" , "OFF" )
170170 . define ( "WHISPER_BUILD_TESTS" , "OFF" )
@@ -267,32 +267,43 @@ fn main() {
267267 config. define ( "GGML_OPENMP" , "OFF" ) ;
268268 }
269269
270+ if cfg ! ( feature = "sycl" ) {
271+ config. define ( "GGML_SYCL" , "ON" ) ;
272+ config. define ( "GGML_SYCL_TARGET" , "INTEL" ) ;
273+ config. define ( "CMAKE_C_COMPILER" , "icx" ) ;
274+ config. define ( "CMAKE_CXX_COMPILER" , "icpx" ) ;
275+ }
276+
270277 let destination = config. build ( ) ;
271278
272279 add_link_search_path ( & out. join ( "build" ) ) . unwrap ( ) ;
273280
274281 println ! ( "cargo:rustc-link-search=native={}" , destination. display( ) ) ;
275- println ! ( "cargo:rustc-link-lib=static= whisper" ) ;
276- println ! ( "cargo:rustc-link-lib=static= ggml" ) ;
277- println ! ( "cargo:rustc-link-lib=static= ggml-base" ) ;
278- println ! ( "cargo:rustc-link-lib=static= ggml-cpu" ) ;
282+ println ! ( "cargo:rustc-link-lib=whisper" ) ;
283+ println ! ( "cargo:rustc-link-lib=ggml" ) ;
284+ println ! ( "cargo:rustc-link-lib=ggml-base" ) ;
285+ println ! ( "cargo:rustc-link-lib=ggml-cpu" ) ;
279286 if cfg ! ( target_os = "macos" ) || cfg ! ( feature = "openblas" ) {
280- println ! ( "cargo:rustc-link-lib=static= ggml-blas" ) ;
287+ println ! ( "cargo:rustc-link-lib=ggml-blas" ) ;
281288 }
282289 if cfg ! ( feature = "vulkan" ) {
283- println ! ( "cargo:rustc-link-lib=static= ggml-vulkan" ) ;
290+ println ! ( "cargo:rustc-link-lib=ggml-vulkan" ) ;
284291 }
285292
286293 if cfg ! ( feature = "hipblas" ) {
287294 println ! ( "cargo:rustc-link-lib=static=ggml-hip" ) ;
288295 }
289296
290297 if cfg ! ( feature = "metal" ) {
291- println ! ( "cargo:rustc-link-lib=static= ggml-metal" ) ;
298+ println ! ( "cargo:rustc-link-lib=ggml-metal" ) ;
292299 }
293300
294301 if cfg ! ( feature = "cuda" ) {
295- println ! ( "cargo:rustc-link-lib=static=ggml-cuda" ) ;
302+ println ! ( "cargo:rustc-link-lib=ggml-cuda" ) ;
303+ }
304+
305+ if cfg ! ( feature = "sycl" ) {
306+ println ! ( "cargo:rustc-link-lib=ggml-sycl" ) ;
296307 }
297308
298309 if cfg ! ( feature = "openblas" ) {
0 commit comments