Get current toolchain in clion


How do that?

1 comment


It depends on what you mean under "current" toolchain.

If you mean "default" toolchain - toolchain that is specified first in the list on "Toolchains" settings page. Then you can do this by using method `CPPToolchains#getDefaultToolchain()`

If you are interested in toolchain associated with the current run configuration then you can use `CMakeAppRunConfiguration#getSelectedConfigurationAndTarget` in conjunction with `CMakeAppRunConfiguration#getBuildAndRunConfigurations(ExecutionTarget)` and `CMakeWorkspace#getProfileInfoFor()` to get profile info. Through it you can get `CPPEnvironment`and associated toolchain.


Please sign in to leave a comment.