From 7395c08ba8c14174ce8c8ff39baeb1a9ea3fc0d4 Mon Sep 17 00:00:00 2001 From: TheGoddessInari Date: Tue, 26 Mar 2019 07:42:18 -0700 Subject: [PATCH 1/2] Bump cc-rs requirement to 1.0.32 to support VS2019. --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 4fc2900..62dbb66 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" From bc6269919a7c94203ced6f8b0a6ebcc7cd125629 Mon Sep 17 00:00:00 2001 From: TheGoddessInari Date: Tue, 26 Mar 2019 07:00:29 -0700 Subject: [PATCH 2/2] Support Visual Studio 2019. --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4e1a378..989b5b6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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") { @@ -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", @@ -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); }