1use serde::{Deserialize, Serialize};
2use strum_macros::Display;
3
4#[derive(Debug, Clone, Default, Serialize, Deserialize)]
6#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
7pub(super) struct BuildConfig {
8 pub(super) profile: Option<Profile>,
11 #[serde(default)]
18 pub(super) runner: Vec<String>,
19}
20
21#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize, Display)]
23#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
24#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
25#[serde(rename_all = "lowercase")]
26#[strum(serialize_all = "lowercase")]
27pub enum Profile {
28 Release,
29 Dev,
30}
31
32impl Profile {
33 pub fn opt_level(self) -> u32 {
35 match self {
36 Self::Release => 3,
37 Self::Dev => 0,
38 }
39 }
40}