diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e3667d06..d45fe681 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -21,9 +21,16 @@ if (NOT SUPPORTS_VARIADIC_TEMPLATES) target_compile_definitions(gmock PUBLIC GTEST_LANG_CXX11=0) endif () -# Workaround a bug in implementation of variadic templates in MSVC11. if (MSVC) + # Workaround a bug in implementation of variadic templates in MSVC11. target_compile_definitions(gmock PUBLIC _VARIADIC_MAX=10) + # Automatic enable exception + target_compile_options(gmock PUBLIC /EHsc) + # Disable MSVC warning of _CRT_INSECURE_DEPRECATE functions and POSIX functions + target_compile_definitions(gmock PUBLIC _CRT_SECURE_NO_WARNINGS) + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_compile_options(gmock PUBLIC -Wno-deprecated-declarations) + endif () endif () # GTest doesn't detect with clang.