[CMake] Clang for Windows with CMake and Ninja (and Visual Studio)

Nagy-Egri Máté Ferenc csiga.biga at aol.com
Tue Sep 12 08:55:43 EDT 2017


Hi!

I am trying to build using the Open Folder feature of VS (with CMake server mode integration) with the Windows binary release of Clang. However, when I try to build using clang++.exe, it argues about unknown compiler switches

clang++.exe: error: no such file or directory: '/nologo'

while if I use the clang-cl.exe front-end of Clang, it fails saying

LINK : fatal error LNK1104: cannot open file 'gdi32.lib'

Does this both inside VS and in a developer command prompt. My invocation is as follows:

cmake -G Ninja -DCMAKE_CXX_COMPILER=C:/Kellekek/LLVM/Clang/5.0/bin/clang++.exe C:\Users\Matty\Source\simplecpp\


My questions:

1. Why does CMake give MSVC params to Clang on Windows?
2. Is there a way to let the clang-cl front-end know how to link to system libraries?

Cheers,
Máté
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170912/9bfd32b2/attachment.html>


More information about the CMake mailing list