mirror of
https://github.com/wez/wezterm.git
synced 2024-12-23 13:21:38 +03:00
Make procinfo's lua dependency optional
This commit is contained in:
parent
dbacf98b89
commit
6166008b18
@ -4,12 +4,15 @@ version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
[features]
|
||||
default = ["lua"]
|
||||
lua = ["dep:luahelper", "dep:wezterm-dynamic"]
|
||||
|
||||
[dependencies]
|
||||
libc = "0.2"
|
||||
log = "0.4"
|
||||
luahelper = { path = "../luahelper" }
|
||||
wezterm-dynamic = { path = "../wezterm-dynamic" }
|
||||
luahelper = { path = "../luahelper", optional = true }
|
||||
wezterm-dynamic = { path = "../wezterm-dynamic", optional = true }
|
||||
|
||||
[target."cfg(windows)".dependencies]
|
||||
ntapi = "0.3"
|
||||
|
@ -1,12 +1,15 @@
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[cfg(feature = "lua")]
|
||||
use wezterm_dynamic::{FromDynamic, ToDynamic};
|
||||
|
||||
mod linux;
|
||||
mod macos;
|
||||
mod windows;
|
||||
|
||||
#[derive(Debug, Copy, Clone, FromDynamic, ToDynamic)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[cfg_attr(feature = "lua", derive(FromDynamic, ToDynamic))]
|
||||
pub enum LocalProcessStatus {
|
||||
Idle,
|
||||
Run,
|
||||
@ -22,7 +25,8 @@ pub enum LocalProcessStatus {
|
||||
Unknown,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, FromDynamic, ToDynamic)]
|
||||
#[derive(Debug, Clone)]
|
||||
#[cfg_attr(feature = "lua", derive(FromDynamic, ToDynamic))]
|
||||
pub struct LocalProcessInfo {
|
||||
/// The process identifier
|
||||
pub pid: u32,
|
||||
@ -55,6 +59,7 @@ pub struct LocalProcessInfo {
|
||||
/// Child processes, keyed by pid
|
||||
pub children: HashMap<u32, LocalProcessInfo>,
|
||||
}
|
||||
#[cfg(feature = "lua")]
|
||||
luahelper::impl_lua_conversion_dynamic!(LocalProcessInfo);
|
||||
|
||||
impl LocalProcessInfo {
|
||||
|
Loading…
Reference in New Issue
Block a user