Search code examples
cliontoolchain

How to switch toolchains in CLion 2018.2?


I started trying to use of CLion 2018.2 today and the first problem with I stuck is how to switch toolchains in CLion.

I want to switch the toolchain from MinGW to Visual Studio and I can switch it by making Visual Studio toolchain as default (File->Settings->Build, Execution, Deployment->Toolchains->Select Visual Studio->Click Up arrow).

enter image description here

But I don't want to make this toolchain as default. I just wanted to try it.

Should I press this up arrow button if I want to switch toolchains or there is any simpler way?

Thanks.


Solution

  • No need to many any toolchain a default one. Do the following:

    1. Configure all necessary toolchains in settings. https://www.jetbrains.com/help/clion/how-to-create-toolchain-in-clion.html
    2. Then in Settings | Build, Execution, Deployment | CMake configure several CMake profiles using different toolchains. https://www.jetbrains.com/help/clion/configuring-cmake.html#CMProfile
    3. Then in the same switcher where you can change the run/debug configuration, there is also a list of available CMake profiles with corresponding toolchains. Select the combination you need and then you can run/debug.