feature cleanup

This commit is contained in:
Grant Limberg 2025-08-14 12:51:22 -07:00
commit d4ee95e445
2 changed files with 26 additions and 13 deletions

View file

@ -5,20 +5,28 @@ use std::env;
use std::path::PathBuf; use std::path::PathBuf;
fn main() { fn main() {
let mut prost_build = prost_build::Config::new(); #[cfg(feature = "ztcontroller")]
{
// Ensure the `cbindgen` crate is available
cbindgen::generate("src/ext.rs")
.expect("Unable to generate bindings")
.write_to_file("rustybits.h");
prost_build let mut prost_build = prost_build::Config::new();
.type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]")
.compile_protos( prost_build
&[ .type_attribute(".", "#[derive(serde::Serialize, serde::Deserialize)]")
"src/pubsub/metadata.proto", .compile_protos(
"src/pubsub/network.proto", &[
"src/pubsub/member.proto", "src/pubsub/metadata.proto",
"src/pubsub/member_status.proto", "src/pubsub/network.proto",
], "src/pubsub/member.proto",
&["src/pubsub/"], "src/pubsub/member_status.proto",
) ],
.expect("Failed to compile protobuf files"); &["src/pubsub/"],
)
.expect("Failed to compile protobuf files");
}
let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();

View file

@ -14,15 +14,20 @@ use std::ffi::{CStr, CString};
use std::os::raw::c_char; use std::os::raw::c_char;
#[cfg(feature = "ztcontroller")] #[cfg(feature = "ztcontroller")]
use std::os::raw::c_void; use std::os::raw::c_void;
#[cfg(feature = "ztcontroller")]
use std::sync::Arc; use std::sync::Arc;
#[cfg(feature = "ztcontroller")]
use std::time::Duration; use std::time::Duration;
#[cfg(feature = "ztcontroller")] #[cfg(feature = "ztcontroller")]
use tokio::runtime; use tokio::runtime;
use url::Url; use url::Url;
#[cfg(feature = "ztcontroller")]
static mut RT: Option<tokio::runtime::Runtime> = None; static mut RT: Option<tokio::runtime::Runtime> = None;
#[cfg(feature = "ztcontroller")]
static START: std::sync::Once = std::sync::Once::new(); static START: std::sync::Once = std::sync::Once::new();
#[cfg(feature = "ztcontroller")]
static SHUTDOWN: std::sync::Once = std::sync::Once::new(); static SHUTDOWN: std::sync::Once = std::sync::Once::new();
#[cfg(feature = "ztcontroller")] #[cfg(feature = "ztcontroller")]