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

pass host to curl configuration command during a cross-compilation #83

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions curl-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ fn main() {
let _ = fs::create_dir(&dst.join("build"));

let mut config_opts = Vec::new();
if target.len() > 0 {
Copy link
Owner

Choose a reason for hiding this comment

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

I think you can also omit this check because this should always be true I believe.

if windows && target.contains("x86_64") {
config_opts.push("--host x86_64-w64-mingw32".to_string());
} else if windows && target.contains("i686") {
config_opts.push("--host i686-w64-mingw32".to_string());
} else {
config_opts.push("--host ".to_string() + &target);
}
}
Copy link
Owner

Choose a reason for hiding this comment

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

I think that this can also be done with:

config_opts.push(format!("--host {}", target.replace("pc-windows-gnu", "w64-mingw32")));

Copy link
Author

Choose a reason for hiding this comment

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

@alexcrichton Oh, right, it's a nice simplification.

if windows {
config_opts.push("--with-winssl".to_string());
} else {
Expand Down