Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 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. | |
| 9 # | |
| 10 # Only use this in third-party code. In chromium_code, fix your code to not | |
| 11 # warn instead! | |
|
scottmg
2014/08/01 21:00:13
Maybe consider calling this file set_clang_warning
| |
| 12 # | |
| 13 # To use this, create a gyp target with the following form: | |
| 14 # Note that the gypi file is included in target_defaults, so it does not need | |
| 15 # to be explicitly included. | |
| 16 # | |
| 17 # Warning flags set by this will be used on all platforms. If you want to set | |
| 18 # warning flags on only some platforms, you have to do so manually. | |
| 19 # | |
| 20 # { | |
| 21 # 'target_name': 'my_target', | |
| 22 # 'variables': { | |
| 23 # 'clang_warning_flags': ['-Wno-awesome-warning'], | |
| 24 # 'clang_warning_flags_unset': ['-Wpreviously-set-flag'], | |
| 25 # } | |
| 26 # } | |
| 27 | |
| 28 { | |
| 29 'variables': { | |
| 30 'clang_warning_flags_unset%': [], # Provide a default value. | |
| 31 }, | |
| 32 'conditions': [ | |
| 33 ['clang==1', { | |
| 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)' ], | |
| 38 'xcode_settings': { | |
| 39 'WARNING_CFLAGS': ['>@(clang_warning_flags)'], | |
| 40 'WARNING_CFLAGS!': ['>@(clang_warning_flags_unset)'], | |
| 41 }, | |
| 42 }], | |
| 43 ], | |
| 44 } | |
| OLD | NEW |