cmake: fix CMP0194 warning on Windows with MSVC#21630
Open
texasich wants to merge 1 commit intoggml-org:masterfrom
Open
cmake: fix CMP0194 warning on Windows with MSVC#21630texasich wants to merge 1 commit intoggml-org:masterfrom
texasich wants to merge 1 commit intoggml-org:masterfrom
Conversation
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#20311
CISC
approved these changes
Apr 8, 2026
| # Set to NEW to avoid a warning on CMake 4.1+ with MSVC. | ||
| if (POLICY CMP0194) | ||
| cmake_policy(SET CMP0194 NEW) | ||
| endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Fix CMP0194 CMake policy warning when building with MSVC on Windows and CMake 4.1+.
The
ggmlsubproject enablesASMglobally viaproject("ggml" C CXX ASM)for Metal (macOS) and KleidiAI (ARM) backends. On Windows/MSVC, no assembler sources are used, but CMake 4.1+ warns becausecl.exeis not a valid ASM compiler.This sets
CMP0194toNEWbefore theproject()call, guarded byif (POLICY CMP0194)for backward compatibility with older CMake versions. This follows the same pattern used inggml-vulkan/CMakeLists.txt(CMP0114, CMP0147).Additional information
Closes #20311