]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
cmake: fix CMP0194 warning on Windows with MSVC (#21630)
authortexasich <redacted>
Tue, 14 Apr 2026 10:47:56 +0000 (05:47 -0500)
committerGitHub <redacted>
Tue, 14 Apr 2026 10:47:56 +0000 (13:47 +0300)
* cmake: fix CMP0194 warning on Windows with MSVC

Set CMP0194 policy to NEW before project() call in ggml/CMakeLists.txt to suppress the "MSVC is not an assembler for language ASM" warning introduced in CMake 4.1.

The ggml project enables ASM globally for Metal (macOS) and KleidiAI (ARM) backends. On Windows/MSVC, no assembler sources are used, but CMake 4.1+ warns because cl.exe is not a valid ASM compiler.

This follows the same pattern used in ggml-vulkan (CMP0114, CMP0147).

Closes ggml-org/llama.cpp#20311

* cmake: apply cisc's formatting suggestion

---------

Co-authored-by: texasich <redacted>
ggml/CMakeLists.txt

index 6bf15723b3c98aabbe4cda8a48acebca046a343b..8454eecde6ee610f5bb3879feef8d19731bf092e 100644 (file)
@@ -1,4 +1,11 @@
 cmake_minimum_required(VERSION 3.14...3.28) # for add_link_options and implicit target directories.
+
+# ref: https://cmake.org/cmake/help/latest/policy/CMP0194.html
+# MSVC is not a valid assembler for the ASM language.
+# Set to NEW to avoid a warning on CMake 4.1+ with MSVC.
+if (POLICY CMP0194)
+    cmake_policy(SET CMP0194 NEW)
+endif()
 project("ggml" C CXX ASM)
 
 ### GGML Version