# Compilers

In CLion, you can use [GCC](https://gcc.gnu.org/)-based compilers, [Clang](https://clang.llvm.org/), [Clang-cl](quick-tutorial-on-configuring-clion-on-windows.html#clang-cl), [Visual Studio C++ compiler](quick-tutorial-on-configuring-clion-on-windows.html#msvc-compiler), as well as [IAR compiler](iar-toolchain.html) and [custom-defined compiler](custom-compilers.html).

## Toolchain compilers (IDE-wide)

The compilers you configure in the currently selected toolchain are used for all the projects you work with in CLion.

> **Tip:**
> By default, CLion detects the compilers from the provided environment (for example, [MinGW](http://www.mingw.org/), [Cygwin](https://www.cygwin.com/), or [Microsoft Visual C++](https://visualstudio.microsoft.com/vs/features/cplusplus/) on Windows) along with other tools.

Procedure: Change toolchain compilers

1. Go to `Settings | Build, Execution, Deployment | Toolchains` and select the toolchain you want to edit.

2. In the C++ Compiler or C Compiler fields specify the path to the desired installation, for example:

![Set the compiler via toolchain](https://resources.jetbrains.com/help/img/idea/2026.2/cl_cmake_switchcompilers_toolchains.png)

## Project compilers

If you need to use non-default compilers, you can change the paths in toolchain settings (IDE-wide) or set the compilers manually, affecting the current project only.

> **Note:**
> In case your project specifies the compilers that differ from those set in the toolchain, CLion will use the project ones.

### Compilers for Cmake projects

For [CMake](quick-cmake-tutorial.html) projects, you can change the compilers in the CMake profile settings defined per project.

Procedure: Change CMake profile compilers

1. Go to  `Settings | Build, Execution, Deployment | CMake`.

2. In the CMake options field, specify the compiler by setting the [CMAKE_LANG_COMPILER](https://cmake.org/cmake/help/v3.10/variable/CMAKE_LANG_COMPILER.html) variable:

```CMAKE
-D CMAKE_<LANG>_COMPILER=[fully qualified compiler name]
```

The `LANG` part specifies the language (C for C and CXX for C++), and you need to provide the full path to the compiler, for example:

![Set the compiler via CMake settings](https://resources.jetbrains.com/help/img/idea/2026.2/cl_cmake_switchcompilers_flag.png)

3. After you apply the settings, CLion will reset the CMake cache and reload your project.

## See also

### Procedures

[Quick CMake Tutorial](quick-cmake-tutorial.html) [Makefile projects support](makefiles-support.html)

### How tos

[Custom compilers](custom-compilers.html) [Set compiler flags](cmake-profile.html#compiler-flags)

