From bf4383e8dd41e9e9146733674d7fbe835e2deace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=A9=D0=B0=D0=BF=D0=BE=D0=B2?= Date: Thu, 25 Mar 2021 20:18:09 +0500 Subject: [PATCH] Fix C++17 builds: - Fix C++17 Visual Studio builds. - Use C++17 for `windows-2019` builds. - Removed options for unsupported compiler (MSVC11). - Removed options, not needed after enabling C++11+ features in gmock/gtest. --- .github/workflows/windows.yml | 2 +- test/CMakeLists.txt | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 0e5ad81a17b7..d250789cd3e3 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -16,7 +16,7 @@ jobs: - os: windows-2016 standard: 11 - os: windows-2019 - standard: 14 + standard: 17 - os: windows-2016 platform: Win32 build_type: Debug diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index fb9207466154..c50bb398d77c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -17,12 +17,9 @@ else () target_compile_definitions(gmock PUBLIC GTEST_HAS_PTHREAD=0) endif () -target_compile_definitions(gmock PUBLIC GTEST_LANG_CXX11=0) +target_compile_definitions(gmock PUBLIC GTEST_LANG_CXX11=1) if (MSVC) - # Workaround a bug in implementation of variadic templates in MSVC11. - target_compile_definitions(gmock PUBLIC _VARIADIC_MAX=10) - # Disable MSVC warnings of _CRT_INSECURE_DEPRECATE functions. target_compile_definitions(gmock PRIVATE _CRT_SECURE_NO_WARNINGS) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") @@ -31,11 +28,6 @@ if (MSVC) endif () endif () -# GTest doesn't detect with clang. -if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - target_compile_definitions(gmock PUBLIC GTEST_USE_OWN_TR1_TUPLE=1) -endif () - # Silence MSVC tr1 deprecation warning in gmock. target_compile_definitions(gmock PUBLIC _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING=1)