1

I'm trying to build a simple C++ project on Windows 10 using Clang version 9.0.0. I can run the following command successful.

clang++ main.cpp -o learn.exe

This produces learn.exe which run successful. I need to be able to run something like this.

cmake -G "Clang Makefiles" ..

and then ...

make

As of current CMake, version 3.15 (even 3.16.0-rc3), there is no Clang generator for CMake that I know. Are there CMake generators for Clang or am I missing something?

Amani
  • 16,245
  • 29
  • 103
  • 153

1 Answers1

2

Selecting the compiler is not done at the generator level, it's done by setting variables to CMake:

cmake -DCMAKE_CXX_COMPILER=clang++ ..
Guillaume Racicot
  • 39,621
  • 9
  • 77
  • 141