]
}
}
+
+ if (use_ubsan) {
+ assert(is_clang && current_os == "linux",
+ "ubsan only supported on Linux/Clang")
+ cflags += [ "-fsanitize=undefined" ]
+ ldflags += [ "-fsanitize=undefined" ]
+ }
+
+ if (use_asan) {
+ assert(is_clang && current_os == "linux",
+ "asan only supported on Linux/Clang")
+ cflags += [ "-fsanitize=address" ]
+ ldflags += [ "-fsanitize=address" ]
+ }
+
+ if (use_tsan) {
+ assert(is_clang && current_os == "linux",
+ "tsan only supported on Linux/Clang")
+ cflags += [ "-fsanitize=thread" ]
+ ldflags += [ "-fsanitize=thread" ]
+ }
}
config("no_exceptions") {
declare_args() {
# Whether to build with debug information.
is_debug = false
+
+ # Whether to build with tsan.
+ use_tsan = false
+
+ # Whether to build with ubsan.
+ use_ubsan = false
+
+ # Whether to build with asan.
+ use_asan = false
}
# args that depend on other args must live in a later declare_args() block.