Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: build/set_clang_warning_flags.gypi

Issue 437543007: Refactor how clang warning flags are set. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « build/common.gypi ('k') | skia/skia_chrome.gypi » ('j') | skia/skia_common.gypi » ('J')

Powered by Google App Engine
This is Rietveld 408576698