From 203efef1472859dc9aef65592a1f608ab9a1343f Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Wed, 19 May 2021 18:37:50 +0200 Subject: [PATCH] Add a flag to allow for linking against shared system protobuf (#7577) In some environments you would like to link to the shared libprotobuf from the system. This is fine to use if you have full control over all protobuf users in your environment. This need for the existence of this option is already mentioned as a comment in CMakeLists.txt, this adds it now. --- cmake/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index a7488e0f2f..77ec4dc75d 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -690,9 +690,9 @@ if(Protobuf_FOUND OR Protobuf_FOUND) #We have a check here but most of the cmake users don't know the Protobuf_USE_STATIC_LIBS # variable exists and may leave it in a wrong state. if(NOT Protobuf_USE_STATIC_LIBS) - #Indeed here should be a warning, not a fatal error. ONNX Runtime itself can work in such a - #setting but it may cause compatibility issue when ONNX Runtime is integrated with the other ONNX ecosystem softwares. - message(FATAL_ERROR "Please enable Protobuf_USE_STATIC_LIBS") + # ONNX Runtime itself can work in such a setting but it may cause compatibility issues + # when ONNX Runtime is integrated with the other ONNX ecosystem softwares. + message(WARNING "Use Protobuf_USE_STATIC_LIBS to ensure compatibility with other ONNX ecosystem components.") endif() else() set(PROTOBUF_LIB protobuf::libprotobuf-lite)