Skip to content

cmake: fix CMP0194 warning on Windows with MSVC#21630

Merged
ggerganov merged 2 commits into
ggml-org:masterfrom
texasich:fix/cmake-cmp0194-msvc-warning
Apr 14, 2026
Merged

cmake: fix CMP0194 warning on Windows with MSVC#21630
ggerganov merged 2 commits into
ggml-org:masterfrom
texasich:fix/cmake-cmp0194-msvc-warning

Conversation

@texasich

@texasich texasich commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

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
Comment thread ggml/CMakeLists.txt Outdated
@github-actions github-actions Bot added the ggml changes relating to the ggml tensor library for machine learning label Apr 13, 2026
@CISC CISC added the merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge. label Apr 13, 2026
@ggerganov
ggerganov merged commit acc37a4 into ggml-org:master Apr 14, 2026
44 of 47 checks passed
oobabooga added a commit to oobabooga/llama.cpp that referenced this pull request Apr 15, 2026
@oobabooga

Copy link
Copy Markdown
Contributor

This PR breaks Windows builds with MSVC + Ninja on GitHub runners (windows-2022). After this change, ggml-rpc.dll fails to link because ws2_32 is passed as -lws2_32 (GCC-style) instead of ws2_32.lib.

https://github.com/oobabooga/llama-cpp-binaries/actions/runs/24426437282/job/71361327782

I believe CMP0194 NEW causes CMake to find MinGW on the runner's PATH instead of using MSVC for ASM, which leaks GCC-style linker flags into the whole build.

texasich added a commit to texasich/llama.cpp that referenced this pull request Apr 15, 2026
PR ggml-org#21630 switched CMP0194 to NEW, but that exposed an unfortunate interaction on Windows runners that had MinGW earlier on PATH.

CMake ended up selecting MinGW for ASM, and that choice bled GCC-style linker flags into the ggml-rpc.dll link step.

The real issue is that we never needed ASM enabled for the whole ggml project in the first place.

The only assembly sources involved here live under the KleidiAI path, so advertising ASM at the top level gave CMake more room than it needed to make the wrong compiler choice.

This narrows ASM enablement to the KleidiAI block: remove it from project() and call enable_language(ASM) only where those .S files are actually used.

Reported-by: oobabooga
Refs: ggml-org#21630
texasich added a commit to texasich/llama.cpp that referenced this pull request Apr 15, 2026
PR ggml-org#21630 switched CMP0194 to NEW, but that exposed an unfortunate interaction on Windows runners that had MinGW earlier on PATH.

CMake ended up selecting MinGW for ASM, and that choice bled GCC-style linker flags into the ggml-rpc.dll link step.

The real issue is that we never needed ASM enabled for the whole ggml project in the first place.

The only assembly sources involved here live under the KleidiAI path, so advertising ASM at the top level gave CMake more room than it needed to make the wrong compiler choice.

This narrows ASM enablement to the KleidiAI block: remove it from project() and call enable_language(ASM) only where those .S files are actually used.

Reported-by: oobabooga
Refs: ggml-org#21630
texasich added a commit to texasich/llama.cpp that referenced this pull request Apr 15, 2026
ggml-org#21630 added the CMP0194 NEW policy to silence a CMake warning, but on Windows runners it caused CMake to prefer the MinGW toolchain for ASM and broke MSVC builds.

Reverting only that policy block restores the previous working behavior. The CMake 4.1+ warning comes back, but that is cosmetic and does not break any platform.

Reported-by: oobabooga

Refs: ggml-org#21630
@JamePeng

Copy link
Copy Markdown

This PR breaks Windows builds with MSVC + Ninja on GitHub runners (windows-2022). After this change, ggml-rpc.dll fails to link because ws2_32 is passed as -lws2_32 (GCC-style) instead of ws2_32.lib.

https://github.com/oobabooga/llama-cpp-binaries/actions/runs/24426437282/job/71361327782

I believe CMP0194 NEW causes CMake to find MinGW on the runner's PATH instead of using MSVC for ASM, which leaks GCC-style linker flags into the whole build.

Same as me,
image

texasich added a commit to texasich/llama.cpp that referenced this pull request Apr 18, 2026
ggml-org#21630 added the CMP0194 NEW policy to silence a CMake warning, but on Windows runners it caused CMake to prefer the MinGW toolchain for ASM and broke MSVC builds.

Reverting only that policy block restores the previous working behavior. The CMake 4.1+ warning comes back, but that is cosmetic and does not break any platform.

Reported-by: oobabooga

Refs: ggml-org#21630
@jjhartmann

jjhartmann commented Apr 18, 2026

Copy link
Copy Markdown
Contributor

This PR breaks Windows builds with MSVC + Ninja on GitHub runners (windows-2022). After this change, ggml-rpc.dll fails to link because ws2_32 is passed as -lws2_32 (GCC-style) instead of ws2_32.lib.

https://github.com/oobabooga/llama-cpp-binaries/actions/runs/24426437282/job/71361327782

I believe CMP0194 NEW causes CMake to find MinGW on the runner's PATH instead of using MSVC for ASM, which leaks GCC-style linker flags into the whole build.

Same for us as well
image

ggerganov pushed a commit that referenced this pull request Apr 19, 2026
#21630 added the CMP0194 NEW policy to silence a CMake warning, but on Windows runners it caused CMake to prefer the MinGW toolchain for ASM and broke MSVC builds.

Reverting only that policy block restores the previous working behavior. The CMake 4.1+ warning comes back, but that is cosmetic and does not break any platform.

Reported-by: oobabooga

Refs: #21630

Co-authored-by: texasich <texasich@users.noreply.github.com>
mengqin pushed a commit to mengqin/llama.cpp that referenced this pull request Apr 20, 2026
* 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#20311

* cmake: apply cisc's formatting suggestion

---------

Co-authored-by: texasich <texasich@users.noreply.github.com>
ArberSephirotheca pushed a commit to ArberSephirotheca/llama.cpp that referenced this pull request Apr 21, 2026
* 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#20311

* cmake: apply cisc's formatting suggestion

---------

Co-authored-by: texasich <texasich@users.noreply.github.com>
ArberSephirotheca pushed a commit to ArberSephirotheca/llama.cpp that referenced this pull request Apr 21, 2026
ggml-org#21630 added the CMP0194 NEW policy to silence a CMake warning, but on Windows runners it caused CMake to prefer the MinGW toolchain for ASM and broke MSVC builds.

Reverting only that policy block restores the previous working behavior. The CMake 4.1+ warning comes back, but that is cosmetic and does not break any platform.

Reported-by: oobabooga

Refs: ggml-org#21630

Co-authored-by: texasich <texasich@users.noreply.github.com>
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Apr 23, 2026
* 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#20311

* cmake: apply cisc's formatting suggestion

---------

Co-authored-by: texasich <texasich@users.noreply.github.com>
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Apr 23, 2026
ggml-org#21630 added the CMP0194 NEW policy to silence a CMake warning, but on Windows runners it caused CMake to prefer the MinGW toolchain for ASM and broke MSVC builds.

Reverting only that policy block restores the previous working behavior. The CMake 4.1+ warning comes back, but that is cosmetic and does not break any platform.

Reported-by: oobabooga

Refs: ggml-org#21630

Co-authored-by: texasich <texasich@users.noreply.github.com>
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
* 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#20311

* cmake: apply cisc's formatting suggestion

---------

Co-authored-by: texasich <texasich@users.noreply.github.com>
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
ggml-org#21630 added the CMP0194 NEW policy to silence a CMake warning, but on Windows runners it caused CMake to prefer the MinGW toolchain for ASM and broke MSVC builds.

Reverting only that policy block restores the previous working behavior. The CMake 4.1+ warning comes back, but that is cosmetic and does not break any platform.

Reported-by: oobabooga

Refs: ggml-org#21630

Co-authored-by: texasich <texasich@users.noreply.github.com>
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
* 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#20311

* cmake: apply cisc's formatting suggestion

---------

Co-authored-by: texasich <texasich@users.noreply.github.com>
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
ggml-org#21630 added the CMP0194 NEW policy to silence a CMake warning, but on Windows runners it caused CMake to prefer the MinGW toolchain for ASM and broke MSVC builds.

Reverting only that policy block restores the previous working behavior. The CMake 4.1+ warning comes back, but that is cosmetic and does not break any platform.

Reported-by: oobabooga

Refs: ggml-org#21630

Co-authored-by: texasich <texasich@users.noreply.github.com>
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
* 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#20311

* cmake: apply cisc's formatting suggestion

---------

Co-authored-by: texasich <texasich@users.noreply.github.com>
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
ggml-org#21630 added the CMP0194 NEW policy to silence a CMake warning, but on Windows runners it caused CMake to prefer the MinGW toolchain for ASM and broke MSVC builds.

Reverting only that policy block restores the previous working behavior. The CMake 4.1+ warning comes back, but that is cosmetic and does not break any platform.

Reported-by: oobabooga

Refs: ggml-org#21630

Co-authored-by: texasich <texasich@users.noreply.github.com>
fewtarius pushed a commit to fewtarius/CachyLLama that referenced this pull request May 30, 2026
* 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#20311

* cmake: apply cisc's formatting suggestion

---------

Co-authored-by: texasich <texasich@users.noreply.github.com>
fewtarius pushed a commit to fewtarius/CachyLLama that referenced this pull request May 30, 2026
ggml-org#21630 added the CMP0194 NEW policy to silence a CMake warning, but on Windows runners it caused CMake to prefer the MinGW toolchain for ASM and broke MSVC builds.

Reverting only that policy block restores the previous working behavior. The CMake 4.1+ warning comes back, but that is cosmetic and does not break any platform.

Reported-by: oobabooga

Refs: ggml-org#21630

Co-authored-by: texasich <texasich@users.noreply.github.com>
fukuro-kun pushed a commit to fukuro-kun/fukuro-llama-cpp-turboquant that referenced this pull request Jul 5, 2026
* 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#20311

* cmake: apply cisc's formatting suggestion

---------

Co-authored-by: texasich <texasich@users.noreply.github.com>
MrLordCat referenced this pull request in MrLordCat/llama.cpp-with-GUI Jul 16, 2026
* 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 <texasich@users.noreply.github.com>
MrLordCat referenced this pull request in MrLordCat/llama.cpp-with-GUI Jul 16, 2026
#21630 added the CMP0194 NEW policy to silence a CMake warning, but on Windows runners it caused CMake to prefer the MinGW toolchain for ASM and broke MSVC builds.

Reverting only that policy block restores the previous working behavior. The CMake 4.1+ warning comes back, but that is cosmetic and does not break any platform.

Reported-by: oobabooga

Refs: #21630

Co-authored-by: texasich <texasich@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning merge ready A maintainer can use this label to indicate that they consider the changes final and ready to merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

6 participants