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

Support Visual Studio 2019. #71

Merged
merged 2 commits into from
Mar 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ A build dependency for running `cmake` to build a native library
categories = ["development-tools::build-utils"]

[dependencies]
cc = "1.0"
cc = "1.0.32"
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ impl Config {
}
if target.contains("x86_64") && !is_ninja && !using_nmake_generator {
cmd.arg("-Thost=x64");
cmd.arg("-DCMAKE_GENERATOR_PLATFORM=x64");
}
} else if target.contains("redox") {
if !self.defined("CMAKE_SYSTEM_NAME") {
Expand Down Expand Up @@ -706,6 +707,7 @@ impl Config {
use cc::windows_registry::{find_vs_version, VsVers};

let base = match find_vs_version() {
Ok(VsVers::Vs16) => "Visual Studio 16 2019",
Ok(VsVers::Vs15) => "Visual Studio 15 2017",
Ok(VsVers::Vs14) => "Visual Studio 14 2015",
Ok(VsVers::Vs12) => "Visual Studio 12 2013",
Expand All @@ -716,10 +718,8 @@ impl Config {
),
Err(msg) => panic!(msg),
};
if target.contains("i686") {
if target.contains("i686") || target.contains("x86_64") {
base.to_string()
} else if target.contains("x86_64") {
format!("{} Win64", base)
} else {
panic!("unsupported msvc target: {}", target);
}
Expand Down