forked from sanyaade-mobiledev/chromium.src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor how clang warning flags are set.
Previously, every gyp file that wanted to set clang warnings had to check for clang==1 and then set cflags and xcode_settings.WARNING_CFLAGS. Factor this out, so that targets only need to set clang_warning_flags for warnings that apply to all platforms. (Per-platform flags still need to be set manually.) This removes existing duplication from gyp files, and prevents adding more duplication when trying to add the same warning flags for clang/win. BUG=82385 R=hans@chromium.org, scottmg@chromium.org TBR=various owners Review URL: https://codereview.chromium.org/437543007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287092 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
thakis@chromium.org
committed
Aug 1, 2014
1 parent
83d8f43
commit dcbc32c
Showing
13 changed files
with
154 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Copyright (c) 2014 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
# This file is meant to be included to set clang-specific compiler flags. | ||
# To use this the following variable can be defined: | ||
# clang_warning_flags: list: Compiler flags to pass to clang. | ||
# clang_warning_flags_unset: list: Compiler flags to not pass to clang. | ||
# | ||
# Only use this in third-party code. In chromium_code, fix your code to not | ||
# warn instead! | ||
# | ||
# Note that the gypi file is included in target_defaults, so it does not need | ||
# to be explicitly included. | ||
# | ||
# Warning flags set by this will be used on all platforms. If you want to set | ||
# warning flags on only some platforms, you have to do so manually. | ||
# | ||
# To use this, create a gyp target with the following form: | ||
# { | ||
# 'target_name': 'my_target', | ||
# 'variables': { | ||
# 'clang_warning_flags': ['-Wno-awesome-warning'], | ||
# 'clang_warning_flags_unset': ['-Wpreviously-set-flag'], | ||
# } | ||
# } | ||
|
||
{ | ||
'variables': { | ||
'clang_warning_flags_unset%': [], # Provide a default value. | ||
}, | ||
'conditions': [ | ||
['clang==1', { | ||
# This uses >@ instead of @< to also see clang_warning_flags set in | ||
# targets directly, not just the clang_warning_flags in target_defaults. | ||
'cflags': [ '>@(clang_warning_flags)' ], | ||
'cflags!': [ '>@(clang_warning_flags_unset)' ], | ||
'xcode_settings': { | ||
'WARNING_CFLAGS': ['>@(clang_warning_flags)'], | ||
'WARNING_CFLAGS!': ['>@(clang_warning_flags_unset)'], | ||
}, | ||
}], | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.