mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
stylo: Sequentialize binding generation if logging is enabled.
Otherwise the log is useless, and it's even slower than in parallel mode due to the high lock contention.
This commit is contained in:
parent
bea126fb73
commit
e348940296
1 changed files with 14 additions and 9 deletions
|
@ -772,17 +772,22 @@ mod bindings {
|
|||
|
||||
pub fn generate() {
|
||||
use self::common::*;
|
||||
use std::fs;
|
||||
use std::thread;
|
||||
use std::{env, fs, thread};
|
||||
println!("cargo:rerun-if-changed=build_gecko.rs");
|
||||
fs::create_dir_all(&*OUTDIR_PATH).unwrap();
|
||||
bindings::setup_logging();
|
||||
let threads = vec![
|
||||
thread::spawn(|| bindings::generate_structs(BuildType::Debug)),
|
||||
thread::spawn(|| bindings::generate_structs(BuildType::Release)),
|
||||
thread::spawn(|| bindings::generate_bindings()),
|
||||
];
|
||||
for t in threads.into_iter() {
|
||||
t.join().unwrap();
|
||||
if env::var("STYLO_BUILD_LOG").is_ok() {
|
||||
bindings::generate_structs(BuildType::Debug);
|
||||
bindings::generate_structs(BuildType::Release);
|
||||
bindings::generate_bindings();
|
||||
} else {
|
||||
let threads = vec![
|
||||
thread::spawn(|| bindings::generate_structs(BuildType::Debug)),
|
||||
thread::spawn(|| bindings::generate_structs(BuildType::Release)),
|
||||
thread::spawn(|| bindings::generate_bindings()),
|
||||
];
|
||||
for t in threads.into_iter() {
|
||||
t.join().unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue