gtest, gmock: disable incompatible warnings.

gtest and gmock both rely heavily on exit-time destructors, and must
build with -Wno-exit-time-destructors to avoid these warnings.

gmock’s MOCK_METHODn() macros violate
-Wno-inconsistent-missing-override, so this warning is disabled for
direct dependents of gmock.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/984393002
This commit is contained in:
Mark Mentovai 2015-03-08 21:04:49 -04:00
parent 56399b2553
commit db7a933d95
2 changed files with 49 additions and 0 deletions

View File

@ -49,10 +49,48 @@
'sources!': [
'gmock/src/gmock-all.cc',
],
# gmock relies heavily on objects with static storage duration.
'xcode_settings': {
'WARNING_CFLAGS!': [
'-Wexit-time-destructors',
],
},
'cflags!': [
'-Wexit-time-destructors',
],
'direct_dependent_settings': {
'include_dirs': [
'gmock/include',
],
'conditions': [
['clang!=0', {
# The MOCK_METHODn() macros do not specify “override”, which
# triggers this warning in users: “error: 'Method' overrides a
# member function but is not marked 'override'
# [-Werror,-Winconsistent-missing-override]”. Suppress these
# warnings, and add -Wno-unknown-warning-option because only recent
# versions of clang (trunk r220703 and later, version 3.6 and
# later) recognize it.
'conditions': [
['OS=="mac"', {
'xcode_settings': {
'WARNING_CFLAGS': [
'-Wno-inconsistent-missing-override',
'-Wno-unknown-warning-option',
],
},
}],
['OS=="linux"', {
'cflags': [
'-Wno-inconsistent-missing-override',
'-Wno-unknown-warning-option',
],
}],
],
}],
],
},
'export_dependent_settings': [
'../gtest/gtest.gyp:gtest',

View File

@ -53,6 +53,17 @@
'sources!': [
'gtest/src/gtest-all.cc',
],
# gtest relies heavily on objects with static storage duration.
'xcode_settings': {
'WARNING_CFLAGS!': [
'-Wexit-time-destructors',
],
},
'cflags!': [
'-Wexit-time-destructors',
],
'direct_dependent_settings': {
'include_dirs': [
'gtest/include',