File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -530,6 +530,17 @@ onnxruntime_fetchcontent_declare(
530530
531531onnxruntime_fetchcontent_makeavailable(onnx)
532532
533+ # https://github.com/onnx/onnx/pull/7087 introduces onnx_object, which
534+ # creates a target onnx_proto_object. If onnx_proto target does not exist,
535+ # we alias onnx_proto_object to onnx_proto for backward compatibility.
536+ if (NOT TARGET onnx_proto AND TARGET onnx_proto_object)
537+ message (STATUS "Creating onnx_proto static library from onnx_proto_object" )
538+ add_library (onnx_proto STATIC $<TARGET_OBJECTS:onnx_proto_object>)
539+ target_link_libraries (onnx_proto PUBLIC ${PROTOBUF_LIB} )
540+ target_include_directories (onnx_proto PUBLIC $<TARGET_PROPERTY:onnx_proto_object,INTERFACE_INCLUDE_DIRECTORIES >)
541+ target_compile_definitions (onnx_proto PUBLIC $<TARGET_PROPERTY:onnx_proto_object,INTERFACE_COMPILE_DEFINITIONS >)
542+ endif ()
543+
533544if (TARGET ONNX::onnx AND NOT TARGET onnx)
534545 message (STATUS "Aliasing ONNX::onnx to onnx" )
535546 add_library (onnx ALIAS ONNX::onnx)
You can’t perform that action at this time.
0 commit comments