diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index 78009a86df5..11a5a5ac975 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -15,6 +15,12 @@ function(add_llvm_unittest test_dirname) set_target_properties(${test_name}Tests PROPERTIES FOLDER "Tests") endfunction() +# Visual Studio 2012 only supports up to 8 template parameters in +# std::tr1::tuple by default, but gtest requires 10 +if(MSVC AND MSVC_VERSION EQUAL 1700) + add_definitions(-D_VARIADIC_MAX=10) +endif () + add_custom_target(UnitTests) set_target_properties(UnitTests PROPERTIES FOLDER "Tests") diff --git a/utils/unittest/CMakeLists.txt b/utils/unittest/CMakeLists.txt index 73491f0721d..70ed35df2e6 100644 --- a/utils/unittest/CMakeLists.txt +++ b/utils/unittest/CMakeLists.txt @@ -27,6 +27,12 @@ endif() set(LLVM_REQUIRES_RTTI 1) add_definitions( -DGTEST_HAS_RTTI=0 ) +# Visual Studio 2012 only supports up to 8 template parameters in +# std::tr1::tuple by default, but gtest requires 10 +if(MSVC AND MSVC_VERSION EQUAL 1700) + add_definitions(-D_VARIADIC_MAX=10) +endif () + add_llvm_library(gtest googletest/gtest.cc googletest/gtest-death-test.cc