Skip to content

Commit

Permalink
set cmake generator for windows msvc as recommended
Browse files Browse the repository at this point in the history
  • Loading branch information
chippers committed Apr 26, 2020
1 parent 41f86f9 commit 7dd3b57
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion build.rs
@@ -1,3 +1,13 @@
fn main() {
cmake::build("flatbuffers");
let mut config = cmake::Config::new("flatbuffers");

// specially set the visual studio generator version on msvc windows
// this generator is recommended by https://google.github.io/flatbuffers/flatbuffers_guide_building.html
let target = std::env::var("TARGET").unwrap();
let host = std::env::var("HOST").unwrap();
if target.contains("msvc") && host.contains("windows") {
config.generator("Visual Studio 10 Win64");
}

config.build();
}

0 comments on commit 7dd3b57

Please sign in to comment.