| # Copyright 2019 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. |
| |
| declare_args() { |
| # Controls which asserts are enabled. |
| # |
| # `ZX_ASSERT` is always enabled. |
| # |
| # * 0 disables standard C `assert()` and `ZX_DEBUG_ASSERT`. |
| # * 1 disables `ZX_DEBUG_ASSERT`. Standard C `assert()` remains enabled. |
| # * 2 enables all asserts. |
| assert_level = 2 |
| |
| # * 0 means no debugging information. |
| # * 1 means minimal debugging information sufficient to symbolize backtraces. |
| # * 2 means full debugging information for use with a symbolic debugger. |
| symbol_level = 2 |
| } |
| |
| # NOTE: Keep in sync with //build/config/compiler.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_valid = [ |
| "none", |
| "debug", |
| "default", |
| "size", |
| "speed", |
| "sanitizer", |
| "profile", |
| ] |
| |
| assert(_optimize_valid + [ optimize ] - [ optimize ] != _optimize_valid, |
| "`optimize=\"...\"` must be one of $_optimize_valid") |