pub enum CPPSTD {
CPP98,
CPP03,
CPP1x,
CPP1y,
CPP1z,
CPP2a,
}
pub enum CXXFlag {
PositionIndependentCode,
}
pub enum CXXCompilationFlag {
FromString { s: String },
CPPSTD { std: CPPSTD },
IncludeDir { include_dir: String },
Flag { flag: CXXFlag },
None,
}
impl CXXCompilationFlag {
pub fn from_string(s: impl Into<String>) -> Self {
Self::FromString { s: s.into() }
}
}
pub enum CXXLinkFlag {
FromString { s: String },
LibLocation { s: String },
Lib { name: String },
LibShared,
None,
}
impl CXXLinkFlag {
pub fn from_string(s: impl Into<String>) -> Self {
Self::FromString { s: s.into() }
}
}
pub struct CXXCompilationFlags {
flags: Vec<CXXCompilationFlag>,
}
impl CXXCompilationFlags {
pub fn empty() -> Self {
Self::new(vec![])
}
pub fn new(flags: Vec<CXXCompilationFlag>) -> Self {
Self { flags }
}
pub(crate) fn into_flags_iter(self) -> impl Iterator<Item = CXXCompilationFlag> {
self.flags.into_iter()
}
}
pub struct CXXLinkFlags {
flags: Vec<CXXLinkFlag>,
}
impl CXXLinkFlags {
pub fn empty() -> Self {
Self::new(vec![])
}
pub fn new(flags: Vec<CXXLinkFlag>) -> Self {
Self { flags }
}
pub(crate) fn into_flags_iter(self) -> impl Iterator<Item = CXXLinkFlag> {
self.flags.into_iter()
}
}