kordophoned sans kpcli building on macos
This commit is contained in:
@@ -8,8 +8,6 @@ edition = "2021"
|
||||
[dependencies]
|
||||
anyhow = "1.0.93"
|
||||
clap = { version = "4.5.20", features = ["derive"] }
|
||||
dbus = "0.9.7"
|
||||
dbus-tree = "0.9.2"
|
||||
dotenv = "0.15.0"
|
||||
env_logger = "0.11.8"
|
||||
futures-util = "0.3.31"
|
||||
@@ -22,5 +20,11 @@ serde_json = "1.0"
|
||||
time = "0.3.37"
|
||||
tokio = "1.41.1"
|
||||
|
||||
[build-dependencies]
|
||||
# D-Bus dependencies only on Linux
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
dbus = "0.9.7"
|
||||
dbus-tree = "0.9.2"
|
||||
|
||||
# D-Bus codegen only on Linux
|
||||
[target.'cfg(target_os = "linux")'.build-dependencies]
|
||||
dbus-codegen = "0.10.0"
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
const KORDOPHONE_XML: &str = "../kordophoned/include/net.buzzert.kordophonecd.Server.xml";
|
||||
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
fn main() {
|
||||
// No D-Bus codegen on non-Linux platforms
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
fn main() {
|
||||
let out_dir = std::env::var("OUT_DIR").unwrap();
|
||||
let out_path = std::path::Path::new(&out_dir).join("kordophone-client.rs");
|
||||
@@ -10,10 +16,11 @@ fn main() {
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
let xml = std::fs::read_to_string(KORDOPHONE_XML).expect("Error reading server dbus interface");
|
||||
let xml = std::fs::read_to_string(KORDOPHONE_XML)
|
||||
.expect("Error reading server dbus interface");
|
||||
|
||||
let output =
|
||||
dbus_codegen::generate(&xml, &opts).expect("Error generating client dbus interface");
|
||||
let output = dbus_codegen::generate(&xml, &opts)
|
||||
.expect("Error generating client dbus interface");
|
||||
|
||||
std::fs::write(out_path, output).expect("Error writing client dbus code");
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
mod client;
|
||||
mod daemon;
|
||||
mod db;
|
||||
mod printers;
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
mod daemon;
|
||||
|
||||
use anyhow::Result;
|
||||
use clap::{Parser, Subcommand};
|
||||
use log::LevelFilter;
|
||||
|
||||
Reference in New Issue
Block a user