From a734f67978e2fcc7714fec00a297f94144681a2c Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Thu, 18 Sep 2014 09:18:18 -0700 Subject: [PATCH] Check if variadic templates are working --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ff8fd7ed..9200b235 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,6 +86,16 @@ add_library(gmock gmock/gmock-gtest-all.cc) find_package(Threads) target_link_libraries(gmock ${CMAKE_THREAD_LIBS_INIT}) +# Check if variadic templates are working and not affected by GCC bug 39653: +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39653 +check_cxx_source_compiles(" + template + struct S { typedef typename S::type type; }; + int main() {}" FMT_VARIADIC_TEMPLATES) +if (NOT FMT_VARIADIC_TEMPLATES) + target_compile_definitions(gmock PUBLIC GTEST_LANG_CXX11=0) +endif () + # GTest doesn't detect with clang. if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") target_compile_definitions(gmock PUBLIC GTEST_USE_OWN_TR1_TUPLE=1)