From 8ae77dbc0f78d8ff2e6073d629f51d4bb64dd935 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Wed, 4 Jan 2017 23:40:06 +0000 Subject: [PATCH] [gtest] Fix the way we disable a warning for unittests. I somehow wrote this fix and then lost it prior to commit. Really sorry about the noise. This should fix some issues with hacking add_definition to do things with warning flags. llvm-svn: 291033 --- cmake/modules/AddLLVM.cmake | 4 ++++ unittests/CMakeLists.txt | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index f35fcf444d2..fbef1d04eac 100644 --- a/cmake/modules/AddLLVM.cmake +++ b/cmake/modules/AddLLVM.cmake @@ -1014,6 +1014,10 @@ function(add_unittest test_suite test_name) if (SUPPORTS_NO_VARIADIC_MACROS_FLAG) list(APPEND LLVM_COMPILE_FLAGS "-Wno-variadic-macros") endif () + # Some parts of gtest rely on this GNU extension, don't warn on it. + if(SUPPORTS_NO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG) + list(APPEND LLVM_COMPILE_FLAGS "-Wno-gnu-zero-variadic-macro-arguments") + endif() set(LLVM_REQUIRES_RTTI OFF) diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index ffa06f038d0..8dbca211d02 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -1,11 +1,6 @@ add_custom_target(UnitTests) set_target_properties(UnitTests PROPERTIES FOLDER "Tests") -# Some parts of gtest rely on this GNU extension, don't warn on it. -if(SUPPORTS_NO_GNU_ZERO_VARIADIC_MACRO_ARGUMENTS_FLAG) - add_definitions("-Wno-gnu-zero-variadic-macro-arguments") -endif() - function(add_llvm_unittest test_dirname) add_unittest(UnitTests ${test_dirname} ${ARGN}) endfunction()