diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index 5b5be953767..2ff5c29c6b1 100644 --- a/cmake/modules/AddLLVM.cmake +++ b/cmake/modules/AddLLVM.cmake @@ -1405,6 +1405,10 @@ function(add_unittest test_suite test_name) set(EXCLUDE_FROM_ALL ON) endif() + # Our current version of gtest uses tr1/tuple which is deprecated on MSVC. + # Since LLVM itself requires C++14, we can safely force it off. + add_definitions(-DGTEST_HAS_TR1_TUPLE=0) + include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include) include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googlemock/include) if (NOT LLVM_ENABLE_THREADS) diff --git a/utils/unittest/CMakeLists.txt b/utils/unittest/CMakeLists.txt index 9127ebce7b4..e7caf37727f 100644 --- a/utils/unittest/CMakeLists.txt +++ b/utils/unittest/CMakeLists.txt @@ -19,6 +19,9 @@ include_directories( googlemock ) +# Gtest 1.8.0 uses tr1/tuple which is deprecated on MSVC, so we force it off. +add_definitions(-DGTEST_HAS_TR1_TUPLE=0) + if(WIN32) add_definitions(-DGTEST_OS_WINDOWS=1) endif()