Windows 10: Blender clang build fails

Completely new here,

Just thinking If I can squeeze a bit of perf out by building with clang, but have been unsuccessful

D:\sources\blender\intern\ghost\intern\GHOST_Wintab.cpp(191,14): error: non-constant-expression cannot be narrowed from type 'int' to 'std::vector<tagPACKET>::size_type' (aka 'unsigned long long') in initializer list [-Wc++11-narrowing]
D:\sources\blender\intern\ghost\intern\GHOST_Wintab.cpp(191,14): note: insert an explicit cast to silence this issue
             static_cast<size_type>( )
1 error generated.
[30/4805] Building CXX object intern\ghost\CMakeFiles\bf_intern_ghost.dir\intern\GHOST_WindowWin32.cpp.obj
ninja: build stopped: subcommand failed.
Error during build

using visual studio 2022, latest version, clang 14.0.6 compiled locally.
have to mention alot of warnings are omitted with -w so the error shows, but no other changes to blender source.

built with make ninja clang 2022, have seen some warnings related to the wrong msvc version when configurating cmake but it just continues.

Is building with clang even supported anymore?

Clang on windows is not an officially supported configuration for us and gets no regular testing/CI, when time permits I try to keep it building, but recently that time has been rather limited and things have seemingly broken.

Patches that fix things are welcome but that’s about the best I can commit to at this point.

1 Like