Add ./mach build --with-layout-2020

… with corresponding `layout` and `layout_thread` crates,
which for now do nothing.
This commit is contained in:
Simon Sapin 2019-06-27 17:03:19 +02:00
parent c1e9347dee
commit 2b01c26aa5
19 changed files with 186 additions and 12 deletions

View file

@ -20,6 +20,8 @@ energy-profiling = ["profile_traits/energy-profiling"]
profilemozjs = ["script/profilemozjs"]
googlevr = ["webvr/googlevr"]
js_backtrace = ["script/js_backtrace"]
layout-2013 = ["layout_thread_2013"]
layout-2020 = ["layout_thread_2020"]
max_log_level = ["log/release_max_level_info"]
native-bluetooth = ["bluetooth/native-bluetooth"]
no_wgl = ["canvas/no_wgl"]
@ -53,7 +55,8 @@ gfx = {path = "../gfx"}
gleam = "0.6"
ipc-channel = "0.11"
keyboard-types = "0.4"
layout_thread = {path = "../layout_thread"}
layout_thread_2013 = {path = "../layout_thread", optional = true}
layout_thread_2020 = {path = "../layout_thread_2020", optional = true}
log = "0.4"
msg = {path = "../msg"}
net = {path = "../net"}

20
components/servo/build.rs Normal file
View file

@ -0,0 +1,20 @@
/* 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 https://mozilla.org/MPL/2.0/. */
fn main() {
let layout_2013 = std::env::var_os("CARGO_FEATURE_LAYOUT_2013").is_some();
let layout_2020 = std::env::var_os("CARGO_FEATURE_LAYOUT_2020").is_some();
if !(layout_2013 || layout_2020) {
error("Must enable one of the `layout-2013` or `layout-2020` features.")
}
if layout_2013 && layout_2020 {
error("Must not enable both of the `layout-2013` or `layout-2020` features.")
}
}
fn error(message: &str) {
print!("\n\n Error: {}\n\n", message);
std::process::exit(1)
}