Kaynağa Gözat

[spirv] Silence GoogleTest std::tr1 deprecation warnings (#894)

Lei Zhang 7 yıl önce
ebeveyn
işleme
ea1bf8d24c

+ 3 - 0
external/GTestConfig.cmake

@@ -21,6 +21,9 @@ include_directories(
 
 if(WIN32)
   add_definitions(-DGTEST_OS_WINDOWS=1)
+  # GoogleTest uses std::tr1, which is deprecated in VS2017.
+  # The following is an escape-hatch macro to silence the deprecation warnings.
+  add_definitions(-D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
 endif()
 
 if(SUPPORTS_VARIADIC_MACROS_FLAG)

+ 5 - 0
tools/clang/unittests/SPIRV/CMakeLists.txt

@@ -21,6 +21,11 @@ add_clang_unittest(clang-spirv-tests
   WholeFileTestFixture.cpp
   )
 
+target_compile_definitions(clang-spirv-tests PRIVATE
+  # GoogleTest uses std::tr1, which is deprecated in VS2017.
+  # The following is an escape-hatch macro to silence the deprecation warnings.
+  -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
+
 target_link_libraries(clang-spirv-tests
   clangCodeGen
   clangFrontend