From b9eb1dc21efb8ee8739a34f403d7f21dc9e88cee Mon Sep 17 00:00:00 2001 From: Jake Mathern Date: Thu, 20 Jun 2024 16:28:15 -0700 Subject: [PATCH] Update protobuf_cmake.patch to allow extra disablements configurable by projects that build ORT (#20875) ### Description Update protobuf_cmake.patch to allow extra disablements. ORT repo already patches protobuf to not disable the warning 4996. ### Motivation and Context To meet SDL requirements, Microsoft repos have to fail build if there is warning 4996 Binskim also gives errors if warning 4996 is disabled. We can suppress the Binskim issues, but we need a way to disable the warnings for the minimal set of code that has them. Right now, WindowsAI disables 4996 for entirety of ORT, but it should only be disabled for protobuf. --- cmake/patches/protobuf/protobuf_cmake.patch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/patches/protobuf/protobuf_cmake.patch b/cmake/patches/protobuf/protobuf_cmake.patch index 00e1f6f81d..e315420e4d 100644 --- a/cmake/patches/protobuf/protobuf_cmake.patch +++ b/cmake/patches/protobuf/protobuf_cmake.patch @@ -12,11 +12,12 @@ index 04cb3303a..c023001de 100644 /wd4305 # 'identifier' : truncation from 'type1' to 'type2' /wd4307 # 'operator' : integral constant overflow /wd4309 # 'conversion' : truncation of constant value -@@ -259,7 +257,6 @@ if (MSVC) +@@ -259,7 +257,7 @@ if (MSVC) /wd4355 # 'this' : used in base member initializer list /wd4506 # no definition for inline function 'function' /wd4800 # 'type' : forcing value to bool 'true' or 'false' (performance warning) - /wd4996 # The compiler encountered a deprecated declaration. ++ ${onnxruntime_PROTOBUF_EXTRA_WARNING_DISABLEMENT} ) # Allow big object add_definitions(/bigobj)