From 88d344fa7c17a4934a3bba24505a1bc3b9819121 Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Sat, 18 May 2024 07:05:55 +0900 Subject: [PATCH] [Darwin] Disable NSAsserts in release builds. Chromium has a similar gn flag to disable asserts in release builds: https://source.chromium.org/chromium/chromium/src/+/main:build/config/BUILD.gn;drc=9dab28144192cefadbb96b778ef866ea3deb74ff;l=148 Related: https://github.com/flutter/flutter/issues/148279 --- build/config/BUILD.gn | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn index 4e629655bf..867c19b5ea 100644 --- a/build/config/BUILD.gn +++ b/build/config/BUILD.gn @@ -84,6 +84,11 @@ config("debug") { config("release") { defines = [ "NDEBUG" ] + if (is_mac || is_ios) { + # Disable NSAsserts in release builds. + defines += [ "NS_BLOCK_ASSERTIONS=1" ] + } + # Sanitizers. # TODO(GYP) The GYP build has "release_valgrind_build == 0" for this # condition. When Valgrind is set up, we need to do the same here.