From f6823221d32323825c1f317c1d7dc44068743b00 Mon Sep 17 00:00:00 2001 From: vitaut Date: Sun, 12 Apr 2015 06:45:40 -0700 Subject: [PATCH 1/3] Workaround broken tuple in MSVC11 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a91b015..7c9cd9c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,7 +153,7 @@ endif () #endif () # GTest doesn't detect with clang. -if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR MSVC) target_compile_definitions(gmock PUBLIC GTEST_USE_OWN_TR1_TUPLE=1) endif () From cea64132a2dde68f55172fa6426302d1227b5434 Mon Sep 17 00:00:00 2001 From: vitaut Date: Sun, 12 Apr 2015 07:02:49 -0700 Subject: [PATCH 2/3] Detect tuple --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c9cd9c3..fa64ac1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -152,8 +152,12 @@ endif () # add_definitions(-DFMT_USE_STATIC_ASSERT=1) #endif () +check_cxx_source_compiles(" + #include + int main(){ std::tuple t; }" FMT_TUPLE) + # GTest doesn't detect with clang. -if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR MSVC) +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR NOT FMT_TUPLE) target_compile_definitions(gmock PUBLIC GTEST_USE_OWN_TR1_TUPLE=1) endif () From 0963fd0a4d08692b6bcd2d86837d469cdd1734f0 Mon Sep 17 00:00:00 2001 From: vitaut Date: Sun, 12 Apr 2015 14:33:11 -0700 Subject: [PATCH 3/3] Workaround a bug in implementation of variadic templates in MSVC11 --- CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fa64ac1a..8b089c3b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -152,12 +152,13 @@ endif () # add_definitions(-DFMT_USE_STATIC_ASSERT=1) #endif () -check_cxx_source_compiles(" - #include - int main(){ std::tuple t; }" FMT_TUPLE) +# Workaround a bug in implementation of variadic templates in MSVC11. +if (MSVC) + target_compile_definitions(gmock PUBLIC _VARIADIC_MAX=10) +endif () # GTest doesn't detect with clang. -if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR NOT FMT_TUPLE) +if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") target_compile_definitions(gmock PUBLIC GTEST_USE_OWN_TR1_TUPLE=1) endif ()