[gn build] Allow use_asan=true on macOS

Seems to work.

(I only tried macOS, not iOS, but need to allow both because
the iOS toolchain used to build compiler-rt asserts otherwise.)
This commit is contained in:
Nico Weber 2021-07-22 21:38:00 -04:00
parent 377320fe80
commit 4a76bd0e31
1 changed files with 3 additions and 2 deletions

View File

@ -314,8 +314,9 @@ config("compiler_defaults") {
}
if (use_asan) {
assert(is_clang && current_os == "linux",
"asan only supported on Linux/Clang")
assert(is_clang && (current_os == "ios" || current_os == "linux" ||
current_os == "mac"),
"asan only supported on iOS/Clang, Linux/Clang, and macOS/Clang")
cflags += [ "-fsanitize=address" ]
ldflags += [ "-fsanitize=address" ]
}