diff --git a/tools/cmake/preset/llm.cmake b/tools/cmake/preset/llm.cmake index 231a25f0c1e..86a1c0dbe1b 100644 --- a/tools/cmake/preset/llm.cmake +++ b/tools/cmake/preset/llm.cmake @@ -16,13 +16,21 @@ set_overridable_option(EXECUTORCH_BUILD_EXTENSION_TENSOR ON) set_overridable_option(EXECUTORCH_BUILD_KERNELS_OPTIMIZED ON) set_overridable_option(EXECUTORCH_BUILD_XNNPACK ON) -# Turn on the quantized and LLM kernels unless on windows cuda build which -# currently doesn't support this due to using msvc. -if(NOT (EXECUTORCH_BUILD_CUDA AND (CMAKE_SYSTEM_NAME STREQUAL "Windows" - OR CMAKE_SYSTEM_NAME STREQUAL "WIN32")) +# Turn on the quantized and LLM kernels unless on Windows with MSVC build since +# they don't currently compile. +if(NOT ((CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL + "WIN32") AND MSVC) ) set_overridable_option(EXECUTORCH_BUILD_KERNELS_QUANTIZED ON) set_overridable_option(EXECUTORCH_BUILD_KERNELS_LLM ON) +else() + if(NOT EXECUTORCH_BUILD_CUDA) + message( + WARNING + "The llm custom kernels and the quantized kernels will not be built when using MSVC on Windows. " + "If you need them (since you appear to be building for CPU) try building with -T ClangCL" + ) + endif() endif() if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")