CLion with clang instead of gcc?



My question is, will using clang instead of gcc matter to CLion? Other than getting my code to build with clang, what can I expect?


Hi, Olof!

We support both GCC and clang and usually it has no difference which one to use. You only need to tell CMake that you need to use compiler different from default one (in case you have both and your default is GCC). To do so go to Preferences/Settings | Build, Execution, Deployment | CMake | CMake options and pass the following commands:


Is this expected to work on windows?

I need to support windows and linux (and OSX) development and I actually don't want to support multiple compilers; cygwin and mingw are totally unacceptable.


Clang offers windows binaries so I'm not sure if the trouble I'm having figuring out how to make it work is because I'm missing something or on windows clang isn't supported.


I too would like for this to work on windows + clang.  I hope this will be supported for the windows side, perhaps with an option of install a clang toolchain.


Hi all! Please take a look at this forum's discussion about using clang on Windows. 


Please sign in to leave a comment.