From 03917dfd416e794cbaec2328e6f282e8c5847c90 Mon Sep 17 00:00:00 2001 From: Luis Cruz Date: Wed, 4 Dec 2024 17:49:44 +0000 Subject: [PATCH] qnap: Make qnap related code conditionally compiled --- ci/build_libtelio.py | 1 + clis/teliod/Cargo.toml | 3 +++ clis/teliod/src/main.rs | 3 +++ 3 files changed, 7 insertions(+) diff --git a/ci/build_libtelio.py b/ci/build_libtelio.py index b0feb98b6..38958ad32 100755 --- a/ci/build_libtelio.py +++ b/ci/build_libtelio.py @@ -296,6 +296,7 @@ def post_qnap_build_wrap_binary_on_qpkg(config, args): "packages": { "teliod": {"teliod": "teliod"}, }, + "build_args": ("--features", "qnap"), }, "macos": { "packages": { diff --git a/clis/teliod/Cargo.toml b/clis/teliod/Cargo.toml index 7bf49854f..7912e6b3d 100644 --- a/clis/teliod/Cargo.toml +++ b/clis/teliod/Cargo.toml @@ -37,3 +37,6 @@ dirs = "4.0.0" [dev-dependencies] rand = "0.8.5" + +[features] +qnap = [] diff --git a/clis/teliod/src/main.rs b/clis/teliod/src/main.rs index 9da7de9e8..78b880aa8 100644 --- a/clis/teliod/src/main.rs +++ b/clis/teliod/src/main.rs @@ -19,6 +19,7 @@ mod configure_interface; mod core_api; mod daemon; mod nc; +#[cfg(feature = "qnap")] mod qnap; use crate::{ @@ -45,6 +46,7 @@ enum Cmd { Daemon { config_path: String }, #[clap(flatten)] Client(ClientCmd), + #[cfg(feature = "qnap")] #[clap(about = "Receive and parse http requests")] Cgi, } @@ -137,6 +139,7 @@ async fn main() -> Result<(), TeliodError> { Err(TeliodError::DaemonIsNotRunning) } } + #[cfg(feature = "qnap")] Cmd::Cgi => { qnap::parse_cgi(); Ok(())