feat: add features flag

This commit is contained in:
YuKun Liu committed 2022-06-06 18:18:22 +08:00
1 parent 6aa609144d
commit d20e7ab508
3 files changed
+28 -1

No files matched your search

+8 -1
View File
@@ -115,6 +115,7 @@ pub struct CrateConfig {
pub dioxus_config: DioxusConfig,
pub release: bool,
pub custom_profile: Option<String>,
pub features: Option<Vec<String>>,
}
#[derive(Debug, Clone)]
@@ -163,8 +164,8 @@ impl CrateConfig {
let executable = ExecutableType::Binary(output_filename);
let release = false;
let custom_profile = None;
let features = None;
Ok(Self {
out_dir,
@@ -177,6 +178,7 @@ impl CrateConfig {
release,
dioxus_config,
custom_profile,
features
})
}
@@ -195,6 +197,11 @@ impl CrateConfig {
self
}
pub fn set_features(&mut self, features: Vec<String>) -> &mut Self {
self.features = Some(features);
self
}
// pub fn with_build_options(&mut self, options: &BuildOptions) {
// if let Some(name) = &options.example {
// self.as_example(name.clone());