[llvm] r291033 - [gtest] Fix the way we disable a warning for unittests.
Chandler Carruth via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 4 15:40:07 PST 2017
Author: chandlerc
Date: Wed Jan 4 17:40:06 2017
New Revision: 291033
URL: http://llvm.org/viewvc/llvm-project?rev=291033&view=rev
Log:
[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.
Modified:
llvm/trunk/cmake/modules/AddLLVM.cmake
llvm/trunk/unittests/CMakeLists.txt
Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=291033&r1=291032&r2=291033&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Wed Jan 4 17:40:06 2017
@@ -1014,6 +1014,10 @@ function(add_unittest test_suite test_na
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)
Modified: llvm/trunk/unittests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/CMakeLists.txt?rev=291033&r1=291032&r2=291033&view=diff
==============================================================================
--- llvm/trunk/unittests/CMakeLists.txt (original)
+++ llvm/trunk/unittests/CMakeLists.txt Wed Jan 4 17:40:06 2017
@@ -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()
More information about the llvm-commits
mailing list