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

Add [target.'cfg(...)'] syntax for rustc(doc)flags in .cargo/config #3854

Merged
merged 1 commit into from
Apr 4, 2017
Merged

Add [target.'cfg(...)'] syntax for rustc(doc)flags in .cargo/config #3854

merged 1 commit into from
Apr 4, 2017

Conversation

tee-too
Copy link
Contributor

@tee-too tee-too commented Mar 22, 2017

Allow to use the Rust cfg(...) syntax to configure rust(doc)flags.
The flags are concatenated when a build matches several cfg, or
several cfg and a $triple.

Fix #3499.

@rust-highfive
Copy link

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@@ -872,11 +873,11 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
}

pub fn rustflags_args(&self, unit: &Unit) -> CargoResult<Vec<String>> {
env_args(self.config, &self.build_config, unit.kind, "RUSTFLAGS")
env_args(self.config, &self.build_config, &self.target_info, unit.kind, "RUSTFLAGS")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this may want to switch between target_info and host_info based off unit.kind

@alexcrichton
Copy link
Member

Thanks for the PR! Just one minor nit but otherwise looks good to me

@@ -178,6 +178,7 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
-> CargoResult<()> {
let rustflags = env_args(self.config,
&self.build_config,
&self.target_info,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the same match should go here too right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure! Thanks.

@alexcrichton
Copy link
Member

@tee-too looks great to me although I think there's still that one spot to add a match? Maybe the matches could become a helper method as well perhaps?

Other than that r=me, you may wish to rebase to clean up the commit history as well but I'm fine either way.

@tee-too
Copy link
Contributor Author

tee-too commented Apr 2, 2017

@alexcrichton rebased and cleaned up.

@alexcrichton
Copy link
Member

@tee-too oh I think there's still one more location for the match?

@alexcrichton
Copy link
Member

(commented above in the PR comments)

Allow to use the Rust `cfg(...)` syntax to configure rust(doc)flags.
The flags are concatenated when a build matches several `cfg`, or
several `cfg` and a $triple.

Fix #3499.
@tee-too
Copy link
Contributor Author

tee-too commented Apr 4, 2017

@alexcrichton I think I understood where was the missing match. Sorry for that.

@alexcrichton
Copy link
Member

@bors: r+

Thanks!

@bors
Copy link
Contributor

bors commented Apr 4, 2017

📌 Commit e6e6f10 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Apr 4, 2017

⌛ Testing commit e6e6f10 with merge f5348cc...

bors added a commit that referenced this pull request Apr 4, 2017
Add `[target.'cfg(...)']` syntax for rustc(doc)flags in .cargo/config

Allow to use the Rust `cfg(...)` syntax to configure rust(doc)flags.
The flags are concatenated when a build matches several `cfg`, or
several `cfg` and a $triple.

Fix #3499.
@bors
Copy link
Contributor

bors commented Apr 4, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing f5348cc to master...

@bors bors merged commit e6e6f10 into rust-lang:master Apr 4, 2017
@ehuss ehuss added this to the 1.18.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow [target.'cfg(...)'] syntax in .cargo/config
5 participants