I have a C++ project that builds using CMake. I usually build on OSX but now I am trying to get a Windows version working too. I would like to use Clang on Windows for compatibility reasons.
I installed the pre-compiled Clang 3.8 binary from LLVM:
C:\Program Files\LLVM\bin\clang.exe
C:\Program Files\LLVM\bin\clang++.exe
It is also installed on my PATH:
>clang++
clang++.exe: error: no input files
I have two questions:
- How do I tell CMake to use
clang++
when I callcmake --build
? - How can I check before building which compiler CMake is configured with?
toolchain.txt
file, lookup for this one in the docs. – πάντα ῥεῖ Jul 3 '16 at 16:20-DCMAKE_CXX_COMPILER=C:/path/to/clang++
? – usr1234567 Jul 3 '16 at 19:14cmake .. && cmake --build .
, but have to except for windos. – K3---rnc Oct 19 '17 at 15:25