From: Nicolò Scipione Date: Fri, 4 Apr 2025 14:00:46 +0000 (+0200) Subject: sycl: allow ggml-sycl configuration and compilation using Visual Studio project/solut... X-Git-Tag: upstream/1.7.5+105~60 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=8f8ede1b1260879f1a233c1a071c344539f432e6;p=pkg%2Fggml%2Fsources%2Fwhisper.cpp sycl: allow ggml-sycl configuration and compilation using Visual Studio project/solution (llama/12625) --- diff --git a/ggml/src/ggml-sycl/CMakeLists.txt b/ggml/src/ggml-sycl/CMakeLists.txt index 6747fd88..6699b70b 100644 --- a/ggml/src/ggml-sycl/CMakeLists.txt +++ b/ggml/src/ggml-sycl/CMakeLists.txt @@ -27,6 +27,15 @@ file(GLOB GGML_HEADERS_SYCL "*.hpp") file(GLOB GGML_SOURCES_SYCL "*.cpp") target_sources(ggml-sycl PRIVATE ${GGML_HEADERS_SYCL} ${GGML_SOURCES_SYCL}) +if (WIN32) + # To generate a Visual Studio solution, using Intel C++ Compiler for ggml-sycl is mandatory + if( ${CMAKE_GENERATOR} MATCHES "Visual Studio" AND NOT (${CMAKE_GENERATOR_TOOLSET} MATCHES "Intel C")) + set_target_properties(ggml-sycl PROPERTIES VS_PLATFORM_TOOLSET "Intel C++ Compiler 2025") + set(CMAKE_CXX_COMPILER "icx") + set(CMAKE_CXX_COMPILER_ID "IntelLLVM") + endif() +endif() + find_package(IntelSYCL) if (IntelSYCL_FOUND) # Use oneAPI CMake when possible