@@ -267,20 +267,39 @@ fn main() {
267267 config. define ( "GGML_OPENMP" , "OFF" ) ;
268268 }
269269
270+ if cfg ! ( feature = "sycl" ) {
271+ config. define ( "BUILD_SHARED_LIBS" , "ON" ) ;
272+ config. define ( "GGML_SYCL" , "ON" ) ;
273+ config. define ( "GGML_SYCL_TARGET" , "INTEL" ) ;
274+ config. define ( "CMAKE_C_COMPILER" , "icx" ) ;
275+ config. define ( "CMAKE_CXX_COMPILER" , "icpx" ) ;
276+ }
277+
270278 let destination = config. build ( ) ;
271279
272280 add_link_search_path ( & out. join ( "build" ) ) . unwrap ( ) ;
273281
274282 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" ) ;
283+ if cfg ! ( feature = "sycl" ) {
284+ println ! ( "cargo:rustc-link-lib=whisper" ) ;
285+ println ! ( "cargo:rustc-link-lib=ggml" ) ;
286+ println ! ( "cargo:rustc-link-lib=ggml-base" ) ;
287+ println ! ( "cargo:rustc-link-lib=ggml-cpu" ) ;
288+ } else {
289+ println ! ( "cargo:rustc-link-lib=static=whisper" ) ;
290+ println ! ( "cargo:rustc-link-lib=static=ggml" ) ;
291+ println ! ( "cargo:rustc-link-lib=static=ggml-base" ) ;
292+ println ! ( "cargo:rustc-link-lib=static=ggml-cpu" ) ;
293+ }
279294 if cfg ! ( target_os = "macos" ) || cfg ! ( feature = "openblas" ) {
280295 println ! ( "cargo:rustc-link-lib=static=ggml-blas" ) ;
281296 }
282297 if cfg ! ( feature = "vulkan" ) {
283- println ! ( "cargo:rustc-link-lib=static=ggml-vulkan" ) ;
298+ if cfg ! ( feature = "sycl" ) {
299+ println ! ( "cargo:rustc-link-lib=ggml-vulkan" ) ;
300+ } else {
301+ println ! ( "cargo:rustc-link-lib=static=ggml-vulkan" ) ;
302+ }
284303 }
285304
286305 if cfg ! ( feature = "hipblas" ) {
@@ -299,6 +318,10 @@ fn main() {
299318 println ! ( "cargo:rustc-link-lib=static=ggml-blas" ) ;
300319 }
301320
321+ if cfg ! ( feature = "sycl" ) {
322+ println ! ( "cargo:rustc-link-lib=ggml-sycl" ) ;
323+ }
324+
302325 println ! (
303326 "cargo:WHISPER_CPP_VERSION={}" ,
304327 get_whisper_cpp_version( & whisper_root)
0 commit comments