Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ahayzen-kdab committed Apr 3, 2024
1 parent 2193add commit 0499874
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gen/lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ mod syntax;

pub use crate::error::Error;
pub use crate::gen::include::{Include, HEADER};
pub use crate::gen::{GeneratedCode, Opt};
pub use crate::gen::{CfgEvaluator, CfgResult, GeneratedCode, Opt};
pub use crate::syntax::IncludeKind;
use proc_macro2::TokenStream;

Expand Down
8 changes: 5 additions & 3 deletions gen/src/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,21 @@ pub struct Opt {
/// Rust code from one shared object or executable depends on these C++
/// functions in another.
pub cxx_impl_annotations: Option<String>,
/// Optional configuration evaluator
pub cfg_evaluator: Box<dyn CfgEvaluator>,

pub(super) gen_header: bool,
pub(super) gen_implementation: bool,
pub(super) allow_dot_includes: bool,
pub(super) cfg_evaluator: Box<dyn CfgEvaluator>,
pub(super) doxygen: bool,
}

pub(super) trait CfgEvaluator {
pub trait CfgEvaluator {
fn eval(&self, name: &str, value: Option<&str>) -> CfgResult;
}

pub(super) enum CfgResult {
/// Results of a [CfgEvaluator]
pub enum CfgResult {
True,
False,
Undetermined { msg: String },
Expand Down

0 comments on commit 0499874

Please sign in to comment.