From 31942b9d1f801b89d064c46013f83baa05dc8e1a Mon Sep 17 00:00:00 2001 From: Vaclav Haisman Date: Sat, 6 Jul 2024 19:52:46 +0200 Subject: [PATCH] Adding /Zc:hiddenFriend- compiler flag to workaround Catch2 complation issue with Visual Studio 2019. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c0bb1d1b..b6cc41e68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,6 +120,10 @@ if (WITH_UNIT_TESTS) if (WIN32) add_compile_definitions (LOG4CPLUS_WITH_UNIT_TESTS=1 NOMINMAX=1) + if (MSVC AND MSVC_TOOLSET_VERSION VERSION_LESS "143") + message (WARNING "Adding /Zc:hiddenFriend- compiler flag to workaround Catch2 complation issue with Visual Studio 2019") + add_compile_options (/Zc:hiddenFriend-) + endif () endif (WIN32) endif (WITH_UNIT_TESTS)