diff --git a/runtime/BUILD.gn b/runtime/BUILD.gn index 6e987c46f07..5a3ee25b4d0 100644 --- a/runtime/BUILD.gn +++ b/runtime/BUILD.gn @@ -12,6 +12,10 @@ declare_args() { # while themselves doing a Debug build. dart_debug = false + # Product mode drops many features (e.g. debugger, profiler, etc) in order to + # shrink download size and decrease memory and cpu usage. + dart_product = false + # Explicitly set the target architecture in case of precompilation. Leaving # this unspecified results in automatic target architecture detection. # Available options are: arm, arm64, mips, x64 and ia32 @@ -50,6 +54,15 @@ config("dart_config") { defines += ["NDEBUG"] } + if (dart_product) { + if (dart_debug) { + print("Debug and product mode are mutually exclusive.") + } + assert(!dart_debug) + defines += ["PRODUCT"] + } + + if (is_ios || is_mac) { defines += ["DART_PRECOMPILER"] } @@ -113,6 +126,14 @@ config("dart_config_no_precompiler") { defines += ["NDEBUG"] } + if (dart_product) { + if (dart_debug) { + print("Debug and product mode are mutually exclusive.") + } + assert(!dart_debug) + defines += ["PRODUCT"] + } + cflags = [ "-Werror", "-Wall",