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

Side by Side Diff: build/common.gypi

Issue 1551753002: Build third-party code with -Wall, build chromium_code with -Wextra on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, and no -Wextra for pnacl-clang in gn for now 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
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 3123 matching lines...) Expand 10 before | Expand all | Expand 10 after
3134 'variables': { 3134 'variables': {
3135 'clang_warning_flags': [ 3135 'clang_warning_flags': [
3136 # Lots of third-party libraries have unused variables. Instead of 3136 # Lots of third-party libraries have unused variables. Instead of
3137 # suppressing them individually, we just blanket suppress them here. 3137 # suppressing them individually, we just blanket suppress them here.
3138 '-Wno-unused-variable', 3138 '-Wno-unused-variable',
3139 ], 3139 ],
3140 }, 3140 },
3141 'conditions': [ 3141 'conditions': [
3142 [ 'os_posix==1 and OS!="mac" and OS!="ios"', { 3142 [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
3143 # We don't want to get warnings from third-party code, 3143 # We don't want to get warnings from third-party code,
3144 # so remove any existing warning-enabling flags like -Wall. 3144 # so remove any existing warning-enabling flags like -Wextra.
3145 'cflags!': [ 3145 'cflags!': [ '-Wextra' ],
3146 '-Wall',
3147 '-Wextra',
3148 ],
3149 'cflags_cc': [ 3146 'cflags_cc': [
3150 # Don't warn about hash_map in third-party code. 3147 # Don't warn about hash_map in third-party code.
3151 '-Wno-deprecated', 3148 '-Wno-deprecated',
3152 ], 3149 ],
3153 'cflags': [ 3150 'cflags': [
3154 # Don't warn about printf format problems. 3151 # Don't warn about printf format problems.
3155 # This is off by default in gcc but on in Ubuntu's gcc(!). 3152 # This is off by default in gcc but on in Ubuntu's gcc(!).
3156 '-Wno-format', 3153 '-Wno-format',
3157 ], 3154 ],
3158 'cflags_cc!': [ 3155 }],
3159 # Necessary because llvm.org/PR10448 is WONTFIX (crbug.com/90453). 3156 [ 'os_posix==1 and clang!=1 and OS!="mac" and OS!="ios"', {
3160 '-Wsign-compare', 3157 # When we don't control the compiler, don't use -Wall for
Nico 2015/12/30 22:53:26 See below why this is no longer needed (this will
3161 ] 3158 # third-party code either.
3159 'cflags!': [ '-Wall' ],
3162 }], 3160 }],
3163 # TODO: Fix all warnings on chromeos too. 3161 # TODO: Fix all warnings on chromeos too.
3164 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos== 1)', { 3162 [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos== 1)', {
3165 'cflags!': [ 3163 'cflags!': [
3166 '-Werror', 3164 '-Werror',
3167 ], 3165 ],
3168 }], 3166 }],
3169 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', { 3167 [ 'os_posix==1 and os_bsd!=1 and OS!="mac" and OS!="android"', {
3170 'cflags': [ 3168 'cflags': [
3171 # Don't warn about ignoring the return value from e.g. close(). 3169 # Don't warn about ignoring the return value from e.g. close().
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
3203 # TODO(darin): Unfortunately, some third_party code depends on bas e. 3201 # TODO(darin): Unfortunately, some third_party code depends on bas e.
3204 'msvs_disabled_warnings': [ 3202 'msvs_disabled_warnings': [
3205 4251, # class 'std::xx' needs to have dll-interface. 3203 4251, # class 'std::xx' needs to have dll-interface.
3206 ], 3204 ],
3207 }], 3205 }],
3208 ], 3206 ],
3209 }], 3207 }],
3210 3208
3211 [ 'OS=="mac" or OS=="ios"', { 3209 [ 'OS=="mac" or OS=="ios"', {
3212 'xcode_settings': { 3210 'xcode_settings': {
3213 'WARNING_CFLAGS!': ['-Wall', '-Wextra'], 3211 'WARNING_CFLAGS!': ['-Wextra'],
3214 }, 3212 },
3215 'conditions': [ 3213 'conditions': [
3216 ['buildtype=="Official"', { 3214 ['buildtype=="Official"', {
3217 'xcode_settings': { 3215 'xcode_settings': {
3218 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror 3216 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
3219 }, 3217 },
3220 }], 3218 }],
3221 ], 3219 ],
3222 }], 3220 }],
3223 [ 'OS=="ios"', { 3221 [ 'OS=="ios"', {
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
3716 '_FILE_OFFSET_BITS=64', 3714 '_FILE_OFFSET_BITS=64',
3717 ], 3715 ],
3718 }], 3716 }],
3719 ['os_posix==1 and OS!="mac" and OS!="ios"', { 3717 ['os_posix==1 and OS!="mac" and OS!="ios"', {
3720 'target_defaults': { 3718 'target_defaults': {
3721 # Enable -Werror by default, but put it in a variable so it can 3719 # Enable -Werror by default, but put it in a variable so it can
3722 # be disabled in ~/.gyp/include.gypi on the valgrind builders. 3720 # be disabled in ~/.gyp/include.gypi on the valgrind builders.
3723 'variables': { 3721 'variables': {
3724 'werror%': '-Werror', 3722 'werror%': '-Werror',
3725 'libraries_for_target%': '', 3723 'libraries_for_target%': '',
3724 'conditions' : [
3725 # Enable -Wextra when we control the compiler.
3726 ['clang==1', { 'wextra': '-Wextra' }, { 'wextra': '-Wno-extra' }],
3727 ],
3726 }, 3728 },
3727 'defines': [ 3729 'defines': [
3728 '_FILE_OFFSET_BITS=64', 3730 '_FILE_OFFSET_BITS=64',
3729 ], 3731 ],
3730 'cflags': [ 3732 'cflags': [
3731 '<(werror)', # See note above about the werror variable. 3733 '<(werror)', # See note above about the werror variable.
3732 '-pthread', 3734 '-pthread',
3733 '-fno-strict-aliasing', # See http://crbug.com/32204 3735 '-fno-strict-aliasing', # See http://crbug.com/32204
3734 '-Wall', 3736 '-Wall',
3737 '<(wextra)',
3735 # Don't warn about unused function params. We use those everywhere. 3738 # Don't warn about unused function params. We use those everywhere.
3736 '-Wno-unused-parameter', 3739 '-Wno-unused-parameter',
3737 # Don't warn about the "struct foo f = {0};" initialization pattern. 3740 # Don't warn about the "struct foo f = {0};" initialization pattern.
3738 '-Wno-missing-field-initializers', 3741 '-Wno-missing-field-initializers',
3739 # Don't export any symbols (for example, to plugins we dlopen()). 3742 # Don't export any symbols (for example, to plugins we dlopen()).
3740 # Note: this is *required* to make some plugins work. 3743 # Note: this is *required* to make some plugins work.
3741 '-fvisibility=hidden', 3744 '-fvisibility=hidden',
3742 '-pipe', 3745 '-pipe',
3743 ], 3746 ],
3744 'cflags_cc': [ 3747 'cflags_cc': [
3745 '-fno-exceptions', 3748 '-fno-exceptions',
3746 '-fno-rtti', 3749 '-fno-rtti',
3747 '-fno-threadsafe-statics', 3750 '-fno-threadsafe-statics',
3748 # Make inline functions have hidden visiblity by default. 3751 # Make inline functions have hidden visiblity by default.
3749 # Surprisingly, not covered by -fvisibility=hidden. 3752 # Surprisingly, not covered by -fvisibility=hidden.
3750 '-fvisibility-inlines-hidden', 3753 '-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',
Nico 2015/12/30 22:53:26 We don't need this anymore because -Wsign-compare
3754 ], 3754 ],
3755 'ldflags': [ 3755 'ldflags': [
3756 '-pthread', '-Wl,-z,noexecstack', 3756 '-pthread', '-Wl,-z,noexecstack',
3757 ], 3757 ],
3758 'libraries' : [ 3758 'libraries' : [
3759 '<(libraries_for_target)', 3759 '<(libraries_for_target)',
3760 ], 3760 ],
3761 'configurations': { 3761 'configurations': {
3762 'Debug_Base': { 3762 'Debug_Base': {
3763 'variables': { 3763 '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 6424 # settings in target dicts. SYMROOT is a special case, because many other
6425 # Xcode variables depend on it, including variables such as 6425 # Xcode variables depend on it, including variables such as
6426 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something 6426 # 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 6427 # 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 6428 # 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, 6429 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
6430 # and therefore SYMROOT, needs to be set at the project level. 6430 # and therefore SYMROOT, needs to be set at the project level.
6431 'SYMROOT': '<(DEPTH)/xcodebuild', 6431 'SYMROOT': '<(DEPTH)/xcodebuild',
6432 }, 6432 },
6433 } 6433 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698