Skip to content

Commit

Permalink
Merge pull request #71 from TheGoddessInari/vs2019
Browse files Browse the repository at this point in the history
Support Visual Studio 2019.
  • Loading branch information
alexcrichton authored Mar 26, 2019
2 parents b090ea8 + bc62699 commit d6bf709
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit d6bf709

Please sign in to comment.