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)