Skip to content

tweak cmake for clang-cl - #6266

Open
mattip wants to merge 1 commit into
OpenMathLib:developfrom
mattip:win-cmake
Open

mattip wants to merge 1 commit into
OpenMathLib:developfrom
mattip:win-cmake

Conversation

@mattip

@mattip mattip commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

I am working on #6255 over at MacPython/openblas-libs#293.

My AI agent and I noticed a very noisy build log on the win-arm64 build, which is being caused by -Wall. This becomes -Weverything on clang-cl (absolutely everything), rather than /W3 (problematic warnings only), emitting lots of warnings. It can also be spelled /clang:-Wall if you want.

We also saw that compilation of dllinit.c was weird. Because the CMake file uses VERBATIM, the flags were being added as a single string of compound arguments (and ignored) rather than as separate arguments. In my build this shows up in the logs as

  "C:\Program Files\LLVM\bin\clang-cl.exe" "-Wno-reserved-macro-identifier ... /DWIN32 /D_WINDOWS
    -DHAVE_C11 -DMS_ABI -Wall -DF_INTERFACE_GFORT ... -DBUILD_COMPLEX16" -IC:/.../OpenBLAS -c -o .../dllinit.o
  warning: unknown warning option '-Wno-reserved-macro-identifier ... -DBUILD_COMPLEX16';                                                                                                               
    did you mean '-Wno-unsafe-buffer-usage-in-unique-ptr-array-access'? [-Wunknown-warning-option]

So dllinit.c compiles with none of those defines or flags — it gets one bogus -W… argument instead. Harmless today (dllinit.c is a bare DllMain), but it silently drops -DMS_ABI, -DMAX_CPU_NUMBER, CRT and optimization flags from that one object.

If you want I can remove the verbose comments from the changes

This branch has not been deployed

No deployments
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.

1 participant