Skip to content

Commit

Permalink
Workaround a bug in implementation of variadic templates in MSVC11
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Apr 12, 2015
1 parent cea6413 commit 0963fd0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,13 @@ endif ()
# add_definitions(-DFMT_USE_STATIC_ASSERT=1)
#endif ()

check_cxx_source_compiles("
#include <tuple>
int main(){ std::tuple<int, double> 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 <tuple> 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 ()

Expand Down

0 comments on commit 0963fd0

Please sign in to comment.