forked from mirrors/gecko-dev
This is the base PR for MSVC builds of servo and dependent crates. It's got replacements in the Cargo.toml to pull in the right versions, to make sure that crates were properly converted to CMake for all other platforms, not just Windows. (Servo builds with MSVC 2015 with this PR; also with 2013, though a manual change in rust-mozjs to select a different set of bindings is needed.) This PR isn't quite ready yet, but I want bors-servo to do builds. Source-Repo: https://github.com/servo/servo Source-Revision: ec53136863f20b80caf165d2f15e8a77d614536e
37 lines
1.5 KiB
Rust
37 lines
1.5 KiB
Rust
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
extern crate cmake;
|
|
use std::env;
|
|
use std::time::Instant;
|
|
|
|
fn main() {
|
|
let start = Instant::now();
|
|
|
|
// This must use the Ninja generator -- it's the only one that
|
|
// parallelizes cmake's output properly. (Cmake generates
|
|
// separate makefiles, each of which try to build
|
|
// ParserResults.pkl, and then stomp on eachother.)
|
|
let mut build = cmake::Config::new(".");
|
|
|
|
let target = env::var("TARGET").unwrap();
|
|
if target.contains("windows-msvc") {
|
|
// We must use Ninja on Windows for this -- msbuild is painfully slow,
|
|
// and ninja is easier to install than make.
|
|
build.generator("Ninja");
|
|
// because we're using ninja, we need to explicitly set these
|
|
// to VC++, otherwise it'll try to use cc
|
|
build.define("CMAKE_C_COMPILER", "cl.exe")
|
|
.define("CMAKE_CXX_COMPILER", "cl.exe");
|
|
// We have to explicitly specify the full path to link.exe,
|
|
// for reasons that I don't understand. If we just give
|
|
// link.exe, it tries to use script-*/out/link.exe, which of
|
|
// course does not exist.
|
|
build.define("CMAKE_LINKER", "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\amd64\\link.exe");
|
|
}
|
|
|
|
build.build();
|
|
|
|
println!("Binding generation completed in {}s", start.elapsed().as_secs());
|
|
}
|