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

Side by Side Diff: build/common.gypi

Issue 1552863004: Linux/CrOS/Cast/Android (and Mac with gn): Build chromium_code with -Wextra. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | build/config/compiler/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # IMPORTANT: 5 # IMPORTANT:
6 # Please don't directly include this file if you are building via gyp_chromium, 6 # Please don't directly include this file if you are building via gyp_chromium,
7 # since gyp_chromium is automatically forcing its inclusion. 7 # since gyp_chromium is automatically forcing its inclusion.
8 { 8 {
9 # Variables expected to be overriden on the GYP command line (-D) or by 9 # Variables expected to be overriden on the GYP command line (-D) or by
10 # ~/.gyp/include.gypi. 10 # ~/.gyp/include.gypi.
(...skipping 3137 matching lines...) Expand 10 before | Expand all | Expand 10 after
3148 ], 3148 ],
3149 'cflags_cc': [ 3149 'cflags_cc': [
3150 # Don't warn about hash_map in third-party code. 3150 # Don't warn about hash_map in third-party code.
3151 '-Wno-deprecated', 3151 '-Wno-deprecated',
3152 ], 3152 ],
3153 'cflags': [ 3153 'cflags': [
3154 # Don't warn about printf format problems. 3154 # Don't warn about printf format problems.
3155 # This is off by default in gcc but on in Ubuntu's gcc(!). 3155 # This is off by default in gcc but on in Ubuntu's gcc(!).
3156 '-Wno-format', 3156 '-Wno-format',
3157 ], 3157 ],
3158 'cflags_cc!': [
3159 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453).
3160 '-Wsign-compare',
3161 ]
3162 }], 3158 }],
3163 # TODO: Fix all warnings on chromeos too. 3159 # TODO: Fix all warnings on chromeos too.
3164 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos== 1)', { 3160 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos== 1)', {
3165 'cflags!': [ 3161 'cflags!': [
3166 '-Werror', 3162 '-Werror',
3167 ], 3163 ],
3168 }], 3164 }],
3169 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', { 3165 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3170 'cflags': [ 3166 'cflags': [
3171 # Don't warn about ignoring the return value from e.g. close(). 3167 # Don't warn about ignoring the return value from e.g. close().
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
3716 '_FILE_OFFSET_BITS=64', 3712 '_FILE_OFFSET_BITS=64',
3717 ], 3713 ],
3718 }], 3714 }],
3719 ['os_posix==1 and OS!="mac" and OS!="ios"', { 3715 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3720 'target_defaults': { 3716 'target_defaults': {
3721 # Enable -Werror by default, but put it in a variable so it can 3717 # Enable -Werror by default, but put it in a variable so it can
3722 # be disabled in ~/.gyp/include.gypi on the valgrind builders. 3718 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3723 'variables': { 3719 'variables': {
3724 'werror%': '-Werror', 3720 'werror%': '-Werror',
3725 'libraries_for_target%': '', 3721 'libraries_for_target%': '',
3722 'conditions' : [
3723 # Enable -Wextra for chromium_code when we control the compiler.
3724 ['clang==1', { 'wextra': '-Wextra' }, { 'wextra': '-Wno-extra' }],
3725 ],
3726 }, 3726 },
3727 'defines': [ 3727 'defines': [
3728 '_FILE_OFFSET_BITS=64', 3728 '_FILE_OFFSET_BITS=64',
3729 ], 3729 ],
3730 'cflags': [ 3730 'cflags': [
3731 '<(werror)', # See note above about the werror variable. 3731 '<(werror)', # See note above about the werror variable.
3732 '-pthread', 3732 '-pthread',
3733 '-fno-strict-aliasing', # See http://crbug.com/32204 3733 '-fno-strict-aliasing', # See http://crbug.com/32204
3734 '-Wall', 3734 '-Wall',
3735 '<(wextra)',
3735 # Don't warn about unused function params. We use those everywhere. 3736 # Don't warn about unused function params. We use those everywhere.
3736 '-Wno-unused-parameter', 3737 '-Wno-unused-parameter',
3737 # Don't warn about the "struct foo f = {0};" initialization pattern. 3738 # Don't warn about the "struct foo f = {0};" initialization pattern.
3738 '-Wno-missing-field-initializers', 3739 '-Wno-missing-field-initializers',
3739 # Don't export any symbols (for example, to plugins we dlopen()). 3740 # Don't export any symbols (for example, to plugins we dlopen()).
3740 # Note: this is *required* to make some plugins work. 3741 # Note: this is *required* to make some plugins work.
3741 '-fvisibility=hidden', 3742 '-fvisibility=hidden',
3742 '-pipe', 3743 '-pipe',
3743 ], 3744 ],
3744 'cflags_cc': [ 3745 'cflags_cc': [
3745 '-fno-exceptions', 3746 '-fno-exceptions',
3746 '-fno-rtti', 3747 '-fno-rtti',
3747 '-fno-threadsafe-statics', 3748 '-fno-threadsafe-statics',
3748 # Make inline functions have hidden visiblity by default. 3749 # Make inline functions have hidden visiblity by default.
3749 # Surprisingly, not covered by -fvisibility=hidden. 3750 # Surprisingly, not covered by -fvisibility=hidden.
3750 '-fvisibility-inlines-hidden', 3751 '-fvisibility-inlines-hidden',
3751 # GCC turns on -Wsign-compare for C++ under -Wall, but clang doesn't,
3752 # so we specify it explicitly. (llvm.org/PR10448, crbug.com/90453)
3753 '-Wsign-compare',
3754 ], 3752 ],
3755 'ldflags': [ 3753 'ldflags': [
3756 '-pthread', '-Wl,-z,noexecstack', 3754 '-pthread', '-Wl,-z,noexecstack',
3757 ], 3755 ],
3758 'libraries' : [ 3756 'libraries' : [
3759 '<(libraries_for_target)', 3757 '<(libraries_for_target)',
3760 ], 3758 ],
3761 'configurations': { 3759 'configurations': {
3762 'Debug_Base': { 3760 'Debug_Base': {
3763 'variables': { 3761 'variables': {
(...skipping 2660 matching lines...) Expand 10 before | Expand all | Expand 10 after
6424 # settings in target dicts. SYMROOT is a special case, because many other 6422 # settings in target dicts. SYMROOT is a special case, because many other
6425 # Xcode variables depend on it, including variables such as 6423 # Xcode variables depend on it, including variables such as
6426 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something 6424 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
6427 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the 6425 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
6428 # files to appear (when present) in the UI as actual files and not red 6426 # files to appear (when present) in the UI as actual files and not red
6429 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, 6427 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
6430 # and therefore SYMROOT, needs to be set at the project level. 6428 # and therefore SYMROOT, needs to be set at the project level.
6431 'SYMROOT': '<(DEPTH)/xcodebuild', 6429 'SYMROOT': '<(DEPTH)/xcodebuild',
6432 }, 6430 },
6433 } 6431 }
OLDNEW
« no previous file with comments | « no previous file | build/config/compiler/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698