mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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>
This commit is contained in:
parent
fb1c57da3e
commit
93fdb8263d
2 changed files with 9 additions and 6 deletions
|
@ -3,7 +3,11 @@
|
|||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
fn main() {
|
||||
cc::Build::new()
|
||||
.file("src/task_info.c")
|
||||
.compile("libtask_info.a");
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
//! A helper crate to get task information on macos.
|
||||
|
||||
#![crate_name = "task_info"]
|
||||
#![crate_type = "rlib"]
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
pub mod task_basic_info;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue