Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to enable features when building project #5078

Closed
RichoDemus opened this issue Mar 10, 2020 · 5 comments
Closed

Not possible to enable features when building project #5078

RichoDemus opened this issue Mar 10, 2020 · 5 comments
Assignees
Labels
answered Issues that have an answer and don't require additional action from maintainers subsystem::build & run Issues related to build action and run configurations

Comments

@RichoDemus
Copy link

Environment

  • CLion 2019.3
  • Windows 10 pro

Problem description

I want to set a feature when building my project (Ctrl+F9)
I've gone through the settings (Lang&Framew/Rust) but the option seems to be lacking

Steps to reproduce

Create a new project, press Ctrl+F9 (build project)
it will print something like this:
C:/Users/<username>/.cargo/bin/cargo.exe build --color=always --all --all-targets

what I'm expecting
adding something like --features "my-feature" in some configuration box in settings and then getting
C:/Users/<username>/.cargo/bin/cargo.exe build --color=always --all --all-targets --features "my-feature"

@mchernyavsky
Copy link
Member

mchernyavsky commented Mar 10, 2020

You can enable the experimental build tool window by setting org.rust.cargo.build.tool.window variable to true (see Actions > Registry...).

Then you can just add --features "my-feature" to "Command" field:

image

@mchernyavsky mchernyavsky self-assigned this Mar 10, 2020
@RichoDemus
Copy link
Author

RichoDemus commented Nov 16, 2020

Thanks for the response, but this only applies to when I run that cargo command, not when I do "build project" (Ctrl+F9) right? while this workaround works, it's a bit unergonomic to not be able to build normally. It also prevents me from running the code by clicking the green triangles in intellij)

@mchernyavsky
Copy link
Member

@RichoDemus Sorry for the long response.

If org.rust.cargo.build.tool.window is enabled "build project" should build the current selected Run configuration. You can see the actual build command line in the Build tool window:

image

@RichoDemus
Copy link
Author

I see thanks
Any words on when this will not be hidden by experimental flags?

@mchernyavsky
Copy link
Member

I hope we will merge #4254 soon and after that, we can enable it by default.

@mchernyavsky mchernyavsky added the answered Issues that have an answer and don't require additional action from maintainers label Dec 3, 2020
@Undin Undin added the subsystem::build & run Issues related to build action and run configurations label Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered Issues that have an answer and don't require additional action from maintainers subsystem::build & run Issues related to build action and run configurations
Projects
None yet
Development

No branches or pull requests

3 participants