llvm.org GIT mirror llvm / 67384e3
Force #define GTEST_LANG_CXX11. gtest depends on this #define to determine whether it can use various classes like std::tuple, or whether it has to fall back to experimental classes in the std::tr1 namespace. The check in the current version of gtest relies on the value of the `__cplusplus` macro, but MSVC provides a non-conformant value of this macro, making it effectively impossible to detect C++11. In short, LLVM compiled with MSVC has been silently using the tr1 versions of several classes since the beginning of time. This would normally be pretty benign, except that in the latest preview of MSVC they have marked all of the tr1 classes deprecated, so it spews thousands of warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316798 91177308-0d34-0410-b5e6-96231b3b80d8 Zachary Turner 1 year, 11 months ago
3 changed file(s) with 15 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
10361036 set(EXCLUDE_FROM_ALL ON)
10371037 endif()
1039 # Our current version of gtest does not properly recognize C++11 support
1040 # with MSVC, so it falls back to tr1 / experimental classes. Since LLVM
1041 # itself requires C++11, we can safely force it on unconditionally so that
1042 # we don't have to fight with the buggy gtest check.
1043 add_definitions(-DGTEST_LANG_CXX11=1)
1044 add_definitions(-DGTEST_HAS_TR1_TUPLE=0)
10391046 include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
10401047 include_directories(${LLVM_MAIN_SRC_DIR}/utils/unittest/googlemock/include)
0 add_definitions(-DGTEST_LANG_CXX11=1)
1 add_definitions(-DGTEST_HAS_TR1_TUPLE=0)
3 add_llvm_library(LLVMTestingSupport
14 Error.cpp
1717 googlemock/include
1818 googlemock
1919 )
21 # LLVM requires C++11 but gtest doesn't correctly detect the availability
22 # of C++11 on MSVC, so we force it on.
23 add_definitions(-DGTEST_LANG_CXX11=1)
24 add_definitions(-DGTEST_HAS_TR1_TUPLE=0)
2126 if(WIN32)
2227 add_definitions(-DGTEST_OS_WINDOWS=1)