Skip to content

Commit cb24b8e

Browse files
authored
Allow specifying YYSTACKDEPTH (parser stack depth) limit via env var (#2000)
2 parents a05ad5d + 417d305 commit cb24b8e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libsql-ffi/build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,11 @@ pub fn build_bundled(out_dir: &str, out_path: &Path) {
370370
cfg.flag("-DSQLITE_ENABLE_SESSION");
371371
}
372372

373+
if let Ok(parser_stack_limit) = env::var("YYSTACKDEPTH") {
374+
cfg.flag(&format!("-DYYSTACKDEPTH={parser_stack_limit}"));
375+
}
376+
println!("cargo:rerun-if-env-changed=YYSTACKDEPTH");
377+
373378
if let Ok(limit) = env::var("SQLITE_MAX_VARIABLE_NUMBER") {
374379
cfg.flag(&format!("-DSQLITE_MAX_VARIABLE_NUMBER={limit}"));
375380
}

0 commit comments

Comments
 (0)