projects/aports·blob master · refs

68 lines · 2.5 KiB

1diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onnxruntime_external_deps.cmake
2index e3b7539664..b746f91df0 100644
3--- a/cmake/external/onnxruntime_external_deps.cmake
4+++ b/cmake/external/onnxruntime_external_deps.cmake
5@@ -35,18 +35,17 @@ message(STATUS "Loading Dependencies ...")
6 include(FetchContent)
7
8 # ABSL should be included before protobuf because protobuf may use absl
9-include(external/abseil-cpp.cmake)
10
11 set(RE2_BUILD_TESTING OFF CACHE BOOL "" FORCE)
12
13-onnxruntime_fetchcontent_declare(
14- re2
15- URL ${DEP_URL_re2}
16- URL_HASH SHA1=${DEP_SHA1_re2}
17- EXCLUDE_FROM_ALL
18- FIND_PACKAGE_ARGS NAMES re2
19-)
20-onnxruntime_fetchcontent_makeavailable(re2)
21+find_package(absl REQUIRED)
22+set(ABSEIL_LIBS absl::inlined_vector absl::flat_hash_set
23+ absl::flat_hash_map absl::node_hash_set absl::node_hash_map absl::base absl::throw_delegate absl::raw_hash_set
24+ absl::hash absl::city absl::hash absl::raw_logging_internal)
25+find_package(Protobuf REQUIRED)
26+find_package(re2 REQUIRED)
27+find_package(nlohmann_json REQUIRED)
28+
29
30 if (onnxruntime_BUILD_UNIT_TESTS)
31 # WebAssembly threading support in Node.js is still an experimental feature and
32@@ -74,7 +73,7 @@ if (onnxruntime_BUILD_UNIT_TESTS)
33 EXCLUDE_FROM_ALL
34 FIND_PACKAGE_ARGS 1.14.0...<2.0.0 NAMES GTest
35 )
36- FetchContent_MakeAvailable(googletest)
37+ find_package(GTest REQUIRED)
38 endif()
39
40 if (onnxruntime_BUILD_BENCHMARKS)
41@@ -219,7 +218,6 @@ if (onnxruntime_DISABLE_RTTI)
42 set(protobuf_DISABLE_RTTI ON CACHE BOOL "Remove runtime type information in the binaries" FORCE)
43 endif()
44
45-include(protobuf_function)
46 #protobuf end
47
48 onnxruntime_fetchcontent_makeavailable(Protobuf)
49@@ -311,7 +309,6 @@ onnxruntime_fetchcontent_declare(
50 EXCLUDE_FROM_ALL
51 FIND_PACKAGE_ARGS 3.10 NAMES nlohmann_json
52 )
53-onnxruntime_fetchcontent_makeavailable(nlohmann_json)
54
55 #TODO: include clog first
56 if (onnxruntime_ENABLE_CPUINFO)
57diff --git a/cmake/onnxruntime_unittests.cmake b/cmake/onnxruntime_unittests.cmake
58index e500645f22..5ef0bc6759 100644
59--- a/cmake/onnxruntime_unittests.cmake
60+++ b/cmake/onnxruntime_unittests.cmake
61@@ -1324,6 +1324,7 @@ if (MSVC)
62 endif()
63 target_include_directories(onnx_test_data_proto PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
64 set_target_properties(onnx_test_data_proto PROPERTIES FOLDER "ONNXRuntimeTest")
65+include(protobuf_function)
66 if(NOT DEFINED onnx_SOURCE_DIR)
67 find_path(onnx_SOURCE_DIR NAMES "onnx/onnx-ml.proto3" "onnx/onnx-ml.proto" REQUIRED)
68 endif()