diff options
Diffstat (limited to 'xtask/src/flags.rs')
-rw-r--r-- | xtask/src/flags.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/xtask/src/flags.rs b/xtask/src/flags.rs index 5710fbdb5..56eda5b1e 100644 --- a/xtask/src/flags.rs +++ b/xtask/src/flags.rs | |||
@@ -1,5 +1,7 @@ | |||
1 | #![allow(unreachable_pub)] | 1 | #![allow(unreachable_pub)] |
2 | 2 | ||
3 | use crate::install::{ClientOpt, Malloc, ServerOpt}; | ||
4 | |||
3 | xflags::args_parser! { | 5 | xflags::args_parser! { |
4 | /// Run custom build command. | 6 | /// Run custom build command. |
5 | cmd xtask { | 7 | cmd xtask { |
@@ -137,3 +139,25 @@ impl Xtask { | |||
137 | } | 139 | } |
138 | } | 140 | } |
139 | // generated end | 141 | // generated end |
142 | |||
143 | impl Install { | ||
144 | pub(crate) fn server(&self) -> Option<ServerOpt> { | ||
145 | if self.client && !self.server { | ||
146 | return None; | ||
147 | } | ||
148 | let malloc = if self.mimalloc { | ||
149 | Malloc::Mimalloc | ||
150 | } else if self.jemalloc { | ||
151 | Malloc::Jemalloc | ||
152 | } else { | ||
153 | Malloc::System | ||
154 | }; | ||
155 | Some(ServerOpt { malloc }) | ||
156 | } | ||
157 | pub(crate) fn client(&self) -> Option<ClientOpt> { | ||
158 | if !self.client && self.server { | ||
159 | return None; | ||
160 | } | ||
161 | Some(ClientOpt { code_bin: self.code_bin.clone() }) | ||
162 | } | ||
163 | } | ||