summaryrefslogtreecommitdiff
path: root/utils/unittest
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2017-01-06 23:16:00 +0000
committerChandler Carruth <chandlerc@gmail.com>2017-01-06 23:16:00 +0000
commit2ff6bc0d1d9426af3e54f84c03fdee986181a906 (patch)
treef85da29468f1c9fa741fec09ba5d8561d99b235d /utils/unittest
parent85430657b9bd30aba2519c9837425594b80e74ce (diff)
[gtest] Detect warning flags using the positive spelling.
Some GCC versions will accept any warning flag name after a '-Wno-', which would cause us to try to disable warnings with names GCC didn't understand. This will silently succeed unless there is some other output from GCC in which case we get weird cc1plus warnings about the warning name being bogus. There is still the issue that gtest sets warning flags for building gtest-all.cc using weird 'add_definitions' and the fact that there is a GCC version which warns on the variadic macro usage in gtest under -pedantic, but has no flag analogous to Clang's -Wgnu-zero-variadic-macro-argumnets to suppress this warning. I haven't been able to come up with any good solution here. The closest is to turn off -pedantic for those versions of GCC, but that seems really nasty. For now, those versinos of GCC aren't warning clean. If anyone is broken by this, I'll work on CMake logic to detect and disable -pedantic in these cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291299 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/unittest')
-rw-r--r--utils/unittest/CMakeLists.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/unittest/CMakeLists.txt b/utils/unittest/CMakeLists.txt
index dadca65b3ae..16a35451274 100644
--- a/utils/unittest/CMakeLists.txt
+++ b/utils/unittest/CMakeLists.txt
@@ -21,10 +21,10 @@ if(WIN32)
add_definitions(-DGTEST_OS_WINDOWS=1)
endif()
-if(SUPPORTS_NO_VARIADIC_MACROS_FLAG)
+if(SUPPORTS_VARIADIC_MACROS_FLAG)
add_definitions("-Wno-variadic-macros")
endif()
-if(SUPPORTS_NO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG)
+if(SUPPORTS_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG)
add_definitions("-Wno-gnu-zero-variadic-macro-arguments")
endif()
if(CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG)