0

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
  • 13,566
  • 21
  • 88
  • 140

1 Answers1

1

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
  • 36,309
  • 8
  • 69
  • 115