|  | # Copyright 2018 The Fuchsia Authors. All rights reserved. | 
|  | # Use of this source code is governed by a BSD-style license that can be | 
|  | # found in the LICENSE file. | 
|  |  | 
|  | if (is_debug) { | 
|  | default_optimize = "debug" | 
|  | } else { | 
|  | # TODO(phosek): consider using "size" in release mode to reduce size. | 
|  | default_optimize = "speed" | 
|  | } | 
|  |  | 
|  | # NOTE: Keep in sync with //zircon/public/gn/config/levels.gni | 
|  | # TODO: Unify the default value between the two builds. | 
|  | declare_args() { | 
|  | # * `none`: really unoptimized, usually only build-tested and not run | 
|  | # * `debug`: "optimized for debugging", light enough to avoid confusion | 
|  | # * `default`: default optimization level | 
|  | # * `size`:  optimized for space rather than purely for speed | 
|  | # * `speed`: optimized purely for speed | 
|  | # * `sanitizer`: optimized for sanitizers (ASan, etc.) | 
|  | # * `profile`: optimized for coverage/profile data collection | 
|  | optimize = default_optimize | 
|  | } | 
|  |  | 
|  | _optimize_valid = [ | 
|  | "none", | 
|  | "debug", | 
|  | "default", | 
|  | "size", | 
|  | "speed", | 
|  | "sanitizer", | 
|  | "profile", | 
|  | ] | 
|  |  | 
|  | assert(_optimize_valid + [ optimize ] - [ optimize ] != _optimize_valid, | 
|  | "`optimize=\"...\"` must be one of $_optimize_valid") | 
|  |  | 
|  | # NOTE: Keep in sync with //zircon/public/gn/config/levels.gni | 
|  | declare_args() { | 
|  | # * `none` means no debugging information | 
|  | # * `backtrace` means sufficient debugging information to symbolize backtraces | 
|  | # * `debug` means debugging information suited for debugging | 
|  | debuginfo = "debug" | 
|  | } | 
|  |  | 
|  | _debuginfo_valid = [ | 
|  | "none", | 
|  | "backtrace", | 
|  | "debug", | 
|  | ] | 
|  |  | 
|  | assert(_debuginfo_valid + [ debuginfo ] - [ debuginfo ] != _debuginfo_valid, | 
|  | "`debuginfo=\"...\"` must be one of $_debuginfo_valid") |