Port the variadic std::tr1::tuple hack for building gtest for MSVC2012 to ASAN tests.
Summary: This is copied from llvm/utils/unittest/CMakeLists.txt.
Test Plan: This partly enables building ASAN tests with MSVC2012.
Reviewers: timurrrr
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5342
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217762 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake
index 0f6260a..31bfa22 100644
--- a/cmake/Modules/AddCompilerRT.cmake
+++ b/cmake/Modules/AddCompilerRT.cmake
@@ -138,6 +138,12 @@
# gtest use a lot of stuff marked as deprecated on Windows.
list(APPEND COMPILER_RT_GTEST_CFLAGS -Wno-deprecated-declarations)
+
+ # Visual Studio 2012 only supports up to 8 template parameters in
+ # std::tr1::tuple by default, but gtest requires 10
+ if(MSVC_VERSION EQUAL 1700)
+ add_definitions(-D_VARIADIC_MAX=10)
+ endif()
endif()
# Link objects into a single executable with COMPILER_RT_TEST_COMPILER,