diff --git a/adm/cmake/occt_defs_flags.cmake b/adm/cmake/occt_defs_flags.cmake
index d1c8172bdd..dc20cc283b 100644
--- a/adm/cmake/occt_defs_flags.cmake
+++ b/adm/cmake/occt_defs_flags.cmake
@@ -25,6 +25,9 @@ if (NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
endif()
if (MSVC)
+ # suppress C26812 on VS2019/C++20 (prefer 'enum class' over 'enum')
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:precise /wd\"26812\"")
+ # suppress warning on using portable non-secure functions in favor of non-portable secure ones
add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
else()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -fPIC")
diff --git a/adm/templates/template.vc10 b/adm/templates/template.vc10
index 158733423c..282b75f90a 100644
--- a/adm/templates/template.vc10
+++ b/adm/templates/template.vc10
@@ -100,7 +100,7 @@
.\..\..\..\win32\__VCVER__\obj\__TKNAM__/
Level4
true
- %(DisableSpecificWarnings)
+ 26812
Precise
NotUsing
__VCMPL32__
@@ -148,7 +148,7 @@
true
ProgramDatabase
Default
- %(DisableSpecificWarnings)
+ 26812
EnableFastChecks
Precise
NotUsing
@@ -196,7 +196,7 @@
.\..\..\..\win64\__VCVER__\obj\__TKNAM__/
Level4
true
- %(DisableSpecificWarnings)
+ 26812
Precise
NotUsing
__VCMPL64__
@@ -244,7 +244,7 @@
true
ProgramDatabase
Default
- %(DisableSpecificWarnings)
+ 26812
EnableFastChecks
Precise
NotUsing
diff --git a/adm/templates/template.vc10x b/adm/templates/template.vc10x
index 07f9c750fe..843376b2cd 100644
--- a/adm/templates/template.vc10x
+++ b/adm/templates/template.vc10x
@@ -95,7 +95,7 @@
.\..\..\..\win32\__VCVER__\obj\__XQTNAM__/
Level4
true
- %(DisableSpecificWarnings)
+ 26812
Precise__VCMPL32__
@@ -140,7 +140,7 @@
true
ProgramDatabase
Default
- %(DisableSpecificWarnings)
+ 26812
EnableFastChecks
Precise__VCMPL32__
@@ -185,7 +185,7 @@
.\..\..\..\win64\__VCVER__\obj\__XQTNAM__/
Level4
true
- %(DisableSpecificWarnings)
+ 26812
Precise__VCMPL64__
@@ -229,7 +229,7 @@
true
ProgramDatabase
Default
- %(DisableSpecificWarnings)
+ 26812
EnableFastChecks
Precise__VCMPL64__