1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-13 19:29:53 +03:00
aports/testing/onnxruntime/upb-fix.patch
2025-05-13 09:52:15 +00:00

27 lines
1.1 KiB
Diff

# Workaround for https://github.com/protocolbuffers/protobuf/issues/18307
# Newer protobuf builds are forcibly bound to libupd which causes conflicts
diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onnxruntime_external_deps.cmake
index ebf20ab21b..a984f38701 100644
--- a/cmake/external/onnxruntime_external_deps.cmake
+++ b/cmake/external/onnxruntime_external_deps.cmake
@@ -230,6 +230,20 @@ endif()
include(protobuf_function)
#protobuf end
+find_library(UPB_LIBRARIES NAMES upb)
+if(NOT TARGET protobuf::libupb)
+ add_library(protobuf::libupb SHARED IMPORTED)
+endif()
+if(NOT TARGET protobuf::protoc-gen-upb)
+ add_executable(protobuf::protoc-gen-upb IMPORTED)
+endif()
+if(NOT TARGET protobuf::protoc-gen-upbdefs)
+ add_executable(protobuf::protoc-gen-upbdefs IMPORTED)
+endif()
+if(NOT TARGET protobuf::protoc-gen-upb_minitable)
+ add_executable(protobuf::protoc-gen-upb_minitable IMPORTED)
+endif()
+
onnxruntime_fetchcontent_makeavailable(Protobuf)
if(Protobuf_FOUND)
message(STATUS "Using protobuf from find_package(or vcpkg). Protobuf version: ${Protobuf_VERSION}")