summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-02-03 14:58:21 +0000
committerCoprDistGit <infra@openeuler.org>2024-02-03 14:58:21 +0000
commitd4b240ae1c1f1a882fed39229a83eaf03aee5dbd (patch)
tree6dadf342f74aadf70028d0e3ed6543d431a1b8b8
parent3870fd55e612786c6ab9d3f81b292ca1a0f2ee2a (diff)
automatic import of onnxruntime
-rw-r--r--0001-use-system-gtest.patch43
-rw-r--r--onnxruntime.spec2
2 files changed, 44 insertions, 1 deletions
diff --git a/0001-use-system-gtest.patch b/0001-use-system-gtest.patch
new file mode 100644
index 0000000..63016ad
--- /dev/null
+++ b/0001-use-system-gtest.patch
@@ -0,0 +1,43 @@
+From 5ef100e524403fc62a6095c4c3d699bd0c84a8fb Mon Sep 17 00:00:00 2001
+From: binsz <274620705z@gmail.com>
+Date: Sat, 3 Feb 2024 18:47:00 +0800
+Subject: [PATCH] use system gtest
+
+---
+ cmake/external/onnxruntime_external_deps.cmake | 13 ++++---------
+ 1 file changed, 4 insertions(+), 9 deletions(-)
+
+diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onnxruntime_external_deps.cmake
+index e91a094..3b7390e 100644
+--- a/cmake/external/onnxruntime_external_deps.cmake
++++ b/cmake/external/onnxruntime_external_deps.cmake
+@@ -43,12 +43,7 @@ if (onnxruntime_BUILD_UNIT_TESTS)
+ set(GTEST_HAS_ABSL OFF CACHE BOOL "" FORCE)
+ endif()
+ # gtest and gmock
+- FetchContent_Declare(
+- googletest
+- URL ${DEP_URL_googletest}
+- FIND_PACKAGE_ARGS 1.13.0...<2.0.0 NAMES GTest
+- URL_HASH SHA1=${DEP_SHA1_googletest}
+- )
++ find_package(GTest REQUIRED)
+ endif()
+
+ if (onnxruntime_BUILD_BENCHMARKS)
+@@ -332,9 +327,9 @@ else()
+ add_library(flatbuffers::flatbuffers ALIAS flatbuffers::flatbuffers_shared)
+ endif()
+
+-if (onnxruntime_BUILD_UNIT_TESTS)
+- onnxruntime_fetchcontent_makeavailable(googletest)
+-endif()
++# if (onnxruntime_BUILD_UNIT_TESTS)
++# onnxruntime_fetchcontent_makeavailable(googletest)
++# endif()
+
+ if(Protobuf_FOUND)
+ message("Protobuf version: ${Protobuf_VERSION}")
+--
+2.41.0
+
diff --git a/onnxruntime.spec b/onnxruntime.spec
index 72e14ba..ed326d3 100644
--- a/onnxruntime.spec
+++ b/onnxruntime.spec
@@ -19,7 +19,7 @@ Patch6: 0001-fix-forward-decl-flatbuffers.patch
Patch7: 0001-add-onnxruntime_INSTALL_UNIT_TESTS-option.patch
Patch8: 0001-gcc-false-positive.patch
Patch9: 0001-versioned-onnxruntime-providers_shared.patch
-# Patch10: 0001-use-system-gtest.patch
+Patch10: 0001-use-system-gtest.patch
BuildRequires: python3-devel
BuildRequires: python3-setuptools