Skip to content

Commit

Permalink
enable aztec macro via an environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
kevaundray committed Nov 30, 2023
1 parent a849a11 commit 5746d40
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ getrandom = "0.2"


cfg-if = "1.0.0"
clap = { version = "4.3.19", features = ["derive"] }
clap = { version = "4.3.19", features = ["derive", "env"] }
codespan = { version = "0.11.1", features = ["serialization"] }
codespan-lsp = "0.11.1"
codespan-reporting = "0.11.1"
Expand Down
9 changes: 8 additions & 1 deletion compiler/noirc_driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,17 @@ pub struct CompileOptions {
pub silence_warnings: bool,

/// Enables the aztec macro preprocessor
#[arg(long, hide = true)]
#[arg(long, env = AZTEC_MACRO_ENV_VAR, hide = true)]
pub aztec_macro: bool,
}

pub(crate) const AZTEC_MACRO_ENV_VAR: &str = "AZTEC_MACROS";

/// Returns true if the `AZTEC_MACROS` environment variable is set.
pub fn is_aztec_environment_variable_set() -> bool {
std::env::var(AZTEC_MACRO_ENV_VAR).is_ok()
}

/// Helper type used to signify where only warnings are expected in file diagnostics
pub type Warnings = Vec<FileDiagnostic>;

Expand Down

0 comments on commit 5746d40

Please sign in to comment.