Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Cleanly override warning level for SelfTest in MSVC

Eliminates warning about warning level override (by removing the default /W3)
Commit
c3a1143d23b9b868543fcfad7baab273aedddaab
Author
philsquared ·
Parents
f580591bf873

Files · Download .tar.gz

Changes

 CMakeLists.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 913f2b07..97a11485 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -317,7 +317,8 @@ if (NOT NO_SELFTEST)
         target_compile_options( SelfTest PRIVATE -Wweak-vtables -Wexit-time-destructors -Wglobal-constructors -Wmissing-noreturn )
     endif()
     if ( CMAKE_CXX_COMPILER_ID MATCHES "MSVC" )
-        target_compile_options( SelfTest PRIVATE /W4 /w44265 /WX /w44061 /w44062 )
+		STRING(REGEX REPLACE "/W[0-9]" "/W4" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # override default warning level
+        target_compile_options( SelfTest PRIVATE /w44265 /WX /w44061 /w44062 )
     endif()