Define ZX_DEBUGLEVEL=2 in is_debug builds
Enable ZX_DEBUG_ASSERT et al in Zircon code.
Change-Id: If82d7e09372ea3b22f69b9c38cee3ca1cff3bfa9
diff --git a/config/BUILDCONFIG.gn b/config/BUILDCONFIG.gn
index 4de3400..19e4abc 100644
--- a/config/BUILDCONFIG.gn
+++ b/config/BUILDCONFIG.gn
@@ -142,6 +142,10 @@
"//build/config/fuchsia:safestack",
"//build/config/fuchsia:thread_safety_annotations",
"//build/config/fuchsia:werror",
+
+ # TODO(mcgrathr): Perhaps restrict this to only affected code.
+ # For now, safest to do it everywhere.
+ "//build/config/fuchsia:zircon_asserts",
]
}
diff --git a/config/fuchsia/BUILD.gn b/config/fuchsia/BUILD.gn
index 2425a5f..42a8337 100644
--- a/config/fuchsia/BUILD.gn
+++ b/config/fuchsia/BUILD.gn
@@ -139,3 +139,12 @@
cflags_cc = [ "-Wthread-safety" ]
defines = [ "_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS" ]
}
+
+config("zircon_asserts") {
+ if (is_debug) {
+ debug_level = 2
+ } else {
+ debug_level = 0
+ }
+ defines = [ "ZX_DEBUGLEVEL=$debug_level" ]
+}