pub struct ProfileFlags {
pub defines: Vec<String>,
pub include_dirs: Vec<PathBuf>,
pub cflags: Vec<String>,
pub cxxflags: Vec<String>,
pub ldflags: Vec<String>,
}Expand description
Manifest-shape build-flag declaration. One per [profile] /
[target.'cfg(...)'.profile] / [profile.<name>] table.
Every field is optional so omission means “no contribution at this layer”. The TOML parser rejects unknown fields explicitly so a future field cannot silently slip through.
Fields§
§defines: Vec<String>Preprocessor macro definitions, one per entry. Each value
is either "NAME" (defines without a value) or
"NAME=value" (defines with an explicit value). Names are
validated at parse time; the planner emits -DNAME /
-DNAME=value directly.
include_dirs: Vec<PathBuf>Additional include directories. Paths are validated at
parse time: absolute paths and any path containing a ..
component are rejected so include-search can never escape
a published source archive.
cflags: Vec<String>Escape-hatch list of arguments appended verbatim to every
C compile command this layer applies to. Use this for
flags that are valid only when compiling C translation
units (e.g. -std=c99). Empty by default.
cxxflags: Vec<String>Escape-hatch list of arguments appended verbatim to every
C++ compile command this layer applies to. Use this
for flags that are valid only when compiling C++
translation units (e.g. -fno-rtti, -std=c++20). Empty
by default.
ldflags: Vec<String>Escape-hatch list of arguments appended verbatim to every link command this layer applies to.
Implementations§
Source§impl ProfileFlags
impl ProfileFlags
pub fn is_empty(&self) -> bool
Sourcepub fn validate(&self) -> Result<(), BuildFlagsValidationError>
pub fn validate(&self) -> Result<(), BuildFlagsValidationError>
Run the validation rules that apply at manifest parse time.
- Defines must be non-empty and must not start with
=. - Include directories must be relative and must not contain
any
..component.
§Errors
Returns BuildFlagsValidationError::EmptyDefine for an empty define,
BuildFlagsValidationError::DefineMissingName for a define starting
with =, and propagates any error from validating an include directory
(a non-relative directory or one containing a .. component).
Trait Implementations§
Source§impl Clone for ProfileFlags
impl Clone for ProfileFlags
Source§fn clone(&self) -> ProfileFlags
fn clone(&self) -> ProfileFlags
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProfileFlags
impl Debug for ProfileFlags
Source§impl Default for ProfileFlags
impl Default for ProfileFlags
Source§fn default() -> ProfileFlags
fn default() -> ProfileFlags
Source§impl<'de> Deserialize<'de> for ProfileFlags
impl<'de> Deserialize<'de> for ProfileFlags
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ProfileFlags
impl PartialEq for ProfileFlags
Source§fn eq(&self, other: &ProfileFlags) -> bool
fn eq(&self, other: &ProfileFlags) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ProfileFlags
impl Serialize for ProfileFlags
impl Eq for ProfileFlags
impl StructuralPartialEq for ProfileFlags
Auto Trait Implementations§
impl Freeze for ProfileFlags
impl RefUnwindSafe for ProfileFlags
impl Send for ProfileFlags
impl Sync for ProfileFlags
impl Unpin for ProfileFlags
impl UnsafeUnpin for ProfileFlags
impl UnwindSafe for ProfileFlags
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.