Skip to content

Commit cadb0db

Browse files
Only block when building with MSVC (#15719)
1 parent 054b15d commit cadb0db

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

tools/cmake/preset/llm.cmake

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,21 @@ set_overridable_option(EXECUTORCH_BUILD_EXTENSION_TENSOR ON)
1616
set_overridable_option(EXECUTORCH_BUILD_KERNELS_OPTIMIZED ON)
1717
set_overridable_option(EXECUTORCH_BUILD_XNNPACK ON)
1818

19-
# Turn on the quantized and LLM kernels unless on windows cuda build which
20-
# currently doesn't support this due to using msvc.
21-
if(NOT (EXECUTORCH_BUILD_CUDA AND (CMAKE_SYSTEM_NAME STREQUAL "Windows"
22-
OR CMAKE_SYSTEM_NAME STREQUAL "WIN32"))
19+
# Turn on the quantized and LLM kernels unless on Windows with MSVC build since
20+
# they don't currently compile.
21+
if(NOT ((CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL
22+
"WIN32") AND MSVC)
2323
)
2424
set_overridable_option(EXECUTORCH_BUILD_KERNELS_QUANTIZED ON)
2525
set_overridable_option(EXECUTORCH_BUILD_KERNELS_LLM ON)
26+
else()
27+
if(NOT EXECUTORCH_BUILD_CUDA)
28+
message(
29+
WARNING
30+
"The llm custom kernels and the quantized kernels will not be built when using MSVC on Windows. "
31+
"If you need them (since you appear to be building for CPU) try building with -T ClangCL"
32+
)
33+
endif()
2634
endif()
2735

2836
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")

0 commit comments

Comments
 (0)