CLion 2026.2.3 doesn't recognize Cargo targets

已回答

What I am trying to do: I'm setting up an embedded Rust workflow with CLion. The reason I am using CLion instead of RustRover is because CLion has a built-in SVD viewer. I am using the Rust plugin, and I can build the code with the default build configuration. The Cargo panel shows my project as a target. Now I am trying to set up an OpenOCD run configuration that will build my code as a pre-launch step. 

The problem: The target that would get built is specified in the run configuration's Target field. Even though the Cargo panel shows my project as a build target, the Target dropdown in the OpenOCD run configuration is empty. I assume that while CMake targets are recognized by CLion, Cargo targets are not.

My current workaround is to first build the code with the default run configuration then switch to the OpenOCD run configuration that I made to debug.

0

Hi Amaaraebrahim!

Currently, the OpenOCD Download & Run configuration works for CMake-based projects, as well as Makefile projects, and custom build targets (see the “OpenOCD support” web-help article). It doesn't support Rust targets yet. Here is the related feature request in our tracker - CPP-18955. Feel free to comment or upvote it to get updates. See the YouTrack notification article if you are not familiar with YouTrack.

As a workaround, you can, for example, create custom build targets and use them in the OpenOCD Download & Run configuration, as described in the “Embedded Rust development with OpenOCD in JetBrains CLion (2023) on Linux” user-written article.

0

请先登录再写评论。