servo/support/rust-task_info/build.rs
Jonathan Schwender 93fdb8263d
Make task_info as macos specific (#32693)
rust-analyzer breaks on Linux (when invoked without mach), because it
tries to compile the c files, and doesn't find `mach_init.h`
Since we don't need task_info on non-mac platforms, just make the
crate empty on other platforms.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-07-04 09:21:49 +00:00

13 lines
427 B
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 https://mozilla.org/MPL/2.0/. */
fn main() {
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
if target_os == "macos" {
cc::Build::new()
.file("src/task_info.c")
.compile("libtask_info.a");
}
}