1 # Copyright (c) 2014 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.
5 # This file is meant to be included to set clang-specific compiler flags.
6 # To use this the following variable can be defined:
7 # clang_warning_flags: list: Compiler flags to pass to clang.
8 # clang_warning_flags_unset: list: Compiler flags to not pass to clang.
10 # Only use this in third-party code. In chromium_code, fix your code to not
13 # Note that the gypi file is included in target_defaults, so it does not need
14 # to be explicitly included.
16 # Warning flags set by this will be used on all platforms. If you want to set
17 # warning flags on only some platforms, you have to do so manually.
19 # To use this, create a gyp target with the following form:
21 # 'target_name': 'my_target',
23 # 'clang_warning_flags': ['-Wno-awesome-warning'],
24 # 'clang_warning_flags_unset': ['-Wpreviously-set-flag'],
30 'clang_warning_flags_unset%': [], # Provide a default value.
34 # This uses >@ instead of @< to also see clang_warning_flags set in
35 # targets directly, not just the clang_warning_flags in target_defaults.
36 'cflags': [ '>@(clang_warning_flags)' ],
37 'cflags!': [ '>@(clang_warning_flags_unset)' ],
39 'WARNING_CFLAGS': ['>@(clang_warning_flags)'],
40 'WARNING_CFLAGS!': ['>@(clang_warning_flags_unset)'],
44 'AdditionalOptions': [ '>@(clang_warning_flags)' ],
45 'AdditionalOptions!': [ '>@(clang_warning_flags_unset)' ],
49 ['clang==0 and host_clang==1', {
50 'target_conditions': [
51 ['_toolset=="host"', {
52 'cflags': [ '>@(clang_warning_flags)' ],
53 'cflags!': [ '>@(clang_warning_flags_unset)' ],