Skip to content

Commit d6bf709

Browse files
authored
Merge pull request #71 from TheGoddessInari/vs2019
Support Visual Studio 2019.
2 parents b090ea8 + bc62699 commit d6bf709

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ A build dependency for running `cmake` to build a native library
1414
categories = ["development-tools::build-utils"]
1515

1616
[dependencies]
17-
cc = "1.0"
17+
cc = "1.0.32"

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ impl Config {
415415
}
416416
if target.contains("x86_64") && !is_ninja && !using_nmake_generator {
417417
cmd.arg("-Thost=x64");
418+
cmd.arg("-DCMAKE_GENERATOR_PLATFORM=x64");
418419
}
419420
} else if target.contains("redox") {
420421
if !self.defined("CMAKE_SYSTEM_NAME") {
@@ -706,6 +707,7 @@ impl Config {
706707
use cc::windows_registry::{find_vs_version, VsVers};
707708

708709
let base = match find_vs_version() {
710+
Ok(VsVers::Vs16) => "Visual Studio 16 2019",
709711
Ok(VsVers::Vs15) => "Visual Studio 15 2017",
710712
Ok(VsVers::Vs14) => "Visual Studio 14 2015",
711713
Ok(VsVers::Vs12) => "Visual Studio 12 2013",
@@ -716,10 +718,8 @@ impl Config {
716718
),
717719
Err(msg) => panic!(msg),
718720
};
719-
if target.contains("i686") {
721+
if target.contains("i686") || target.contains("x86_64") {
720722
base.to_string()
721-
} else if target.contains("x86_64") {
722-
format!("{} Win64", base)
723723
} else {
724724
panic!("unsupported msvc target: {}", target);
725725
}

0 commit comments

Comments
 (0)