mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Print an error message if neither Canvas 2D backend is selected
This commit is contained in:
parent
1df2605292
commit
acd8454b16
1 changed files with 20 additions and 0 deletions
20
components/canvas/build.rs
Normal file
20
components/canvas/build.rs
Normal 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 azure = std::env::var_os("CARGO_FEATURE_CANVAS2D_AZURE").is_some();
|
||||||
|
let raqote = std::env::var_os("CARGO_FEATURE_CANVAS2D_RAQOTE").is_some();
|
||||||
|
|
||||||
|
if !(azure || raqote) {
|
||||||
|
error("Must enable one of the `canvas2d-azure` or `canvas2d-raqote` features.")
|
||||||
|
}
|
||||||
|
if azure && raqote {
|
||||||
|
error("Must not enable both of the `canvas2d-azure` and `canvas2d-raqote` features.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn error(message: &str) {
|
||||||
|
print!("\n\n Error: {}\n\n", message);
|
||||||
|
std::process::exit(1)
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue