Get current toolchain in clion

已回答

How do that?

0

Hi,

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.

1

请先登录再写评论。