end2endzone / RapidAssist

RapidAssist is a lite cross-platform library that assist you with the most c++ repetitive tasks.
MIT License
5 stars 0 forks source link

Silence warning C4996 about deprecated 'std::tr1' namespace - Windows only. #74

Closed end2endzone closed 3 years ago

end2endzone commented 3 years ago

When building on Windows using Visual Studio 2017, the following warnings is displayed whenever a file is including google's test header gtest-printers.h:

D:\dev\RapidAssist\third_parties\googletest\install\include\gtest/gtest-printers.h(605): warning C4996: 'std::tr1': warning STL4002: The non-Standard std::tr1 namespace and TR1-only machinery are deprecated and will be REMOVED. You can define _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING to acknowledge that you have received this warning. [D:\RapidAssist\build\src\rapidassist\rapidassist.vcxproj]

There are multiple warnings which create scrolling blindness. This specific warnings should be disabled since it comes from an external library (googletest).

end2endzone commented 3 years ago

The solution is to ~~add -DCMAKE_CXX_FLAGS=/D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING to all projects that uses gtest library.

[...] define _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING within CMakeLists.txt.