From 4a97072b6d04137bdf7dabdebbf7812bb1ffb452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20M=C3=BCller=20Andersen?= Date: Sun, 14 Jun 2026 21:30:57 +0200 Subject: [PATCH 1/3] fix(cmake): remove ASM language from ggml project to resolve MSVC/CMake detection failure on Windows MSVC toolchains on Windows (especially with modern CMake versions) are not reliably recognized as valid ASM compilers, causing CMake to fail during project() configuration with "No CMAKE_ASM_COMPILER could be found". Although GGML does not strictly require assembly support on Windows (CUDA and CPU backends function without it), the project was declaring ASM in the top-level CMake configuration: project(ggml C CXX ASM) This causes CMake to attempt ASM compiler detection before MSVC MASM (ml64) is properly initialized, leading to hard configuration failures. This change removes ASM from the project declaration: project(ggml C CXX) This avoids premature ASM language enablement and allows the build to proceed normally on MSVC toolchains while still supporting CUDA and CPU backends. Fixes Windows build failures related to CMake ASM detection (CMP194 / MSVC ASM incompatibility). --- ggml/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ggml/CMakeLists.txt b/ggml/CMakeLists.txt index 8454eecde6ee..605d108f4424 100644 --- a/ggml/CMakeLists.txt +++ b/ggml/CMakeLists.txt @@ -6,7 +6,8 @@ cmake_minimum_required(VERSION 3.14...3.28) # for add_link_options and implicit if (POLICY CMP0194) cmake_policy(SET CMP0194 NEW) endif() -project("ggml" C CXX ASM) +# project("ggml" C CXX ASM) +project("ggml" C CXX) ### GGML Version set(GGML_VERSION_MAJOR 0) From b81ca3b3abe19451ba17e51bf2e2db8db3943163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20M=C3=BCller=20Andersen?= Date: Sun, 14 Jun 2026 21:39:34 +0200 Subject: [PATCH 2/3] added comments --- ggml/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ggml/CMakeLists.txt b/ggml/CMakeLists.txt index 605d108f4424..dc128e808006 100644 --- a/ggml/CMakeLists.txt +++ b/ggml/CMakeLists.txt @@ -6,8 +6,8 @@ cmake_minimum_required(VERSION 3.14...3.28) # for add_link_options and implicit if (POLICY CMP0194) cmake_policy(SET CMP0194 NEW) endif() -# project("ggml" C CXX ASM) -project("ggml" C CXX) +# project("ggml" C CXX ASM) # Enable ASM for platform-specific optimizations (x86/ARM). May fail on MSVC/CMake CMP0194. +project("ggml" C CXX) # ASM disabled on MSVC due to CMake ASM detection issues; not required for CUDA/CPU builds. ### GGML Version set(GGML_VERSION_MAJOR 0) From 0d1e26923e32faf5862da0f4533cafc7e84f77ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20M=C3=BCller=20Andersen?= Date: Sun, 14 Jun 2026 21:42:41 +0200 Subject: [PATCH 3/3] cmake: enable ASM conditionally based on compiler capability instead of unconditional MSVC inclusion Replace unconditional ASM language declaration in ggml with a conditional CMake check using `check_language(ASM)`. On MSVC toolchains, modern CMake versions (CMP0194) do not reliably support treating MSVC as a valid ASM compiler, causing configuration failures such as: "No CMAKE_ASM_COMPILER could be found" This change ensures ASM is only enabled when CMake confirms ASM support is available for the current toolchain, while preserving ASM usage on toolchains where it is properly supported (GNU/Clang/NASM/etc). No change in runtime behavior. Windows/MSVC builds are stabilized without disabling ASM globally. --- ggml/CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ggml/CMakeLists.txt b/ggml/CMakeLists.txt index dc128e808006..bec80877ec69 100644 --- a/ggml/CMakeLists.txt +++ b/ggml/CMakeLists.txt @@ -6,8 +6,15 @@ cmake_minimum_required(VERSION 3.14...3.28) # for add_link_options and implicit if (POLICY CMP0194) cmake_policy(SET CMP0194 NEW) endif() -# project("ggml" C CXX ASM) # Enable ASM for platform-specific optimizations (x86/ARM). May fail on MSVC/CMake CMP0194. -project("ggml" C CXX) # ASM disabled on MSVC due to CMake ASM detection issues; not required for CUDA/CPU builds. + +include(CheckLanguage) + +check_language(ASM) +if (CMAKE_ASM_COMPILER AND NOT MSVC) + enable_language(ASM) +endif() + +project("ggml" C CXX) ### GGML Version set(GGML_VERSION_MAJOR 0)