Skip to content

giscanner: Add support for using clang-cl

Chun-wei Fan requested to merge clang-cl into master

Hi,

From the commit message:

This adds quick support for using clang-cl (CLang's emulation of the Visual Studio compiler) to run giscanner.

This will still initialize things mostly in the MSVC fashion, except that it will also check whether both 'CC' and 'CXX' envvars are set to clang-cl, as per the way that Meson supports using clang-cl.

Since we are using distutils to set up the compiler instance, when we enable clang-cl support, we trick distutils that we have already initialized the MSVCCompiler parameters as needed. We just leave out the compiler flags as we don't really care about debug symbols nor optimization with the built dumper binary, as it is gone as soon as the .gir file is generated.

This will build G-I successfully with all the tests passed.

The reasoning behind adding this support is so that we can continue to build GJS fully (albeit without the test programs) on Windows, since the latest GIT master has been upgraded to use SpiderMonkey 78, where it became complicated to build against with Visual Studio. offer more choices to people who intend to build things on Windows, especially when the concerned code relies on more GCCism's and yet wish to access more Windows SDK features than what is offered by the MinGW/mingw-w64 toolchain.

With blessings, thank you!

Edited by Chun-wei Fan

Merge request reports