Skip to content

cmake: fix CMP0194 warning on Windows with MSVC#21630

Open
texasich wants to merge 1 commit intoggml-org:masterfrom
texasich:fix/cmake-cmp0194-msvc-warning
Open

cmake: fix CMP0194 warning on Windows with MSVC#21630
texasich wants to merge 1 commit intoggml-org:masterfrom
texasich:fix/cmake-cmp0194-msvc-warning

Conversation

@texasich
Copy link
Copy Markdown

@texasich texasich commented Apr 8, 2026

Overview

Fix CMP0194 CMake policy warning when building with MSVC on Windows and CMake 4.1+.

The ggml subproject enables ASM globally via project("ggml" C CXX ASM) 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 sets CMP0194 to NEW before the project() call, guarded by if (POLICY CMP0194) for backward compatibility with older CMake versions. This follows the same pattern used in ggml-vulkan/CMakeLists.txt (CMP0114, CMP0147).

Additional information

Closes #20311

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
# Set to NEW to avoid a warning on CMake 4.1+ with MSVC.
if (POLICY CMP0194)
cmake_policy(SET CMP0194 NEW)
endif()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
endif()
endif()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compile bug: CMP194 warning on Windows with MSVC 2026 (CUDA backend)

2 participants