commit e5b81f982df85abcba21ac9110ed07767623c569 Author: Alejandro Alvarez Ayllon Date: Wed Jun 7 14:02:37 2023 +0000 Use system ONNX diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onnxruntime_external_deps.cmake index f2aa9a4c46..d3d28ce5d3 100644 --- a/cmake/external/onnxruntime_external_deps.cmake +++ b/cmake/external/onnxruntime_external_deps.cmake @@ -402,11 +402,12 @@ endif() include(eigen) include(wil) -if (NOT onnxruntime_MINIMAL_BUILD) - onnxruntime_fetchcontent_makeavailable(onnx) -else() - include(onnx_minimal) -endif() +#if (NOT onnxruntime_MINIMAL_BUILD) +# onnxruntime_fetchcontent_makeavailable(onnx) +#else() +# include(onnx_minimal) +#endif() +find_package(ONNX REQUIRED) set(GSL_TARGET "Microsoft.GSL::GSL") set(GSL_INCLUDE_DIR "$") @@ -441,10 +442,10 @@ set(onnxruntime_EXTERNAL_LIBRARIES ${onnxruntime_EXTERNAL_LIBRARIES_XNNPACK} WIL # The other libs do not have the problem. All the sources are already there. We can compile them in any order. set(onnxruntime_EXTERNAL_DEPENDENCIES onnx_proto flatbuffers::flatbuffers) -target_compile_definitions(onnx PUBLIC $ PRIVATE "__ONNX_DISABLE_STATIC_REGISTRATION") -if (NOT onnxruntime_USE_FULL_PROTOBUF) - target_compile_definitions(onnx PUBLIC "__ONNX_NO_DOC_STRINGS") -endif() +#target_compile_definitions(onnx PUBLIC $ PRIVATE "__ONNX_DISABLE_STATIC_REGISTRATION") +#if (NOT onnxruntime_USE_FULL_PROTOBUF) +# target_compile_definitions(onnx PUBLIC "__ONNX_NO_DOC_STRINGS") +#endif() if (onnxruntime_RUN_ONNX_TESTS) add_definitions(-DORT_RUN_EXTERNAL_ONNX_TESTS)