Skip to content

Commit

Permalink
Add an asan feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
weiznich committed Dec 8, 2023
1 parent 411049d commit 5ab1672
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pq-src/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ cc = "1.0.83"

[target.'cfg(not(target_os = "windows"))'.build-dependencies]
openssl-src = "300"

[features]
default = []
with-asan = []
4 changes: 4 additions & 0 deletions pq-src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ fn main() {
format!("{path}/src/include/port/win32_msvc/"),
]);

if cfg!(feature = "with-asan") {
basic_build.flag("-fsanitize=address");
}

if cfg!(target_os = "linux") {
basic_build.define("_GNU_SOURCE", None);
}
Expand Down

0 comments on commit 5ab1672

Please sign in to comment.