dcheck_always_on.gni 1.4 KB

12345678910111213141516171819202122232425262728293031
  1. # Copyright (c) 2016 The Chromium Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file.
  4. # TODO(crbug.com/1233050): Until the bug is resolved we need to include
  5. # gclient_args for the definition of build_with_chromium and build_overrides
  6. # for client overrides of that flag. The latter should go away.
  7. import("//build/config/gclient_args.gni")
  8. import("//build_overrides/build.gni")
  9. declare_args() {
  10. # Enables DCHECKs to be built-in, but to default to being non-fatal/log-only.
  11. # DCHECKS can then be set as fatal/non-fatal via the "DcheckIsFatal" feature.
  12. # See https://bit.ly/dcheck-albatross for details on how this is used.
  13. dcheck_is_configurable = false
  14. }
  15. declare_args() {
  16. # Set to false to disable DCHECK in Release builds. This is enabled by default
  17. # for non-official builds on the below platforms.
  18. # This default only affects Chromium as indicated by build_with_chromium.
  19. # Other clients typically set this to false. If another client wants to use
  20. # the same default value as Chromium, we'd need to add a separate gclient
  21. # variable to replace build_with_chromium here.
  22. dcheck_always_on =
  23. (build_with_chromium && !is_official_build) || dcheck_is_configurable
  24. }
  25. declare_args() {
  26. # Set to false to disable EXPENSIVE_DCHECK()s.
  27. enable_expensive_dchecks = is_debug || dcheck_always_on
  28. }