• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2024 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("$build_root/config/sanitizers/sanitizers.gni")
15
16# This file declares arguments and configs that control whether dSYM debug
17# info is produced and whether build products are stripped.
18
19declare_args() {
20  # Produce dSYM files for targets that are configured to do so. dSYM
21  # generation is controlled globally as it is a linker output (produced via
22  # the //build/toolchain/mac/linker_driver.py. Enabling this will result in
23  # all shared library, loadable module, and executable targets having a dSYM
24  # generated.
25  enable_dsyms = is_official_build || using_sanitizer
26
27  # Strip symbols from linked targets by default. If this is enabled, the
28  # //build/config/mac:strip_all config will be applied to all linked targets.
29  # If custom stripping parameters are required, remove that config from a
30  # linked target and apply custom -Wcrl,strip flags. See
31  # //build/toolchain/mac/linker_driver.py for more information.
32  enable_stripping = is_official_build
33}
34
35# Save unstripped copies of targets with a ".unstripped" suffix. This is
36# useful to preserve the original output when enable_stripping=true but
37# we're not actually generating real dSYMs.
38save_unstripped_output = enable_stripping && !enable_dsyms
39