From 9b356c305e8ee980d2ed914cb8b477c6b819c703 Mon Sep 17 00:00:00 2001 From: Florian de Gaulejac Date: Tue, 19 Dec 2023 13:50:00 +0100 Subject: [PATCH] CMake: ensure conan dependencies are used (upstreamed future versions) --- recipes/onnxruntime/all/conandata.yml | 3 ++ .../1.14.1-0006-cmake-dependencies.patch | 29 +++++++++++++++++++ .../1.15.1-0001-cmake-dependencies.patch | 27 +++++++++++++++++ .../1.16.0-0001-cmake-dependencies.patch | 27 +++++++++++++++++ 4 files changed, 86 insertions(+) create mode 100644 recipes/onnxruntime/all/patches/1.14.1-0006-cmake-dependencies.patch diff --git a/recipes/onnxruntime/all/conandata.yml b/recipes/onnxruntime/all/conandata.yml index b051b06768621..c3aff8ec7da5c 100644 --- a/recipes/onnxruntime/all/conandata.yml +++ b/recipes/onnxruntime/all/conandata.yml @@ -72,3 +72,6 @@ patches: patch_description: "Ensures the forward compatibility with the newest versions of re2 library." patch_type: "portability" patch_source: "https://github.com/microsoft/onnxruntime/commit/126e7bf15fa4af8621814b82a3f7bd0d786f0239.patch" + - patch_file: "patches/1.14.1-0006-cmake-dependencies.patch" + patch_description: "CMake: ensure conan dependencies are used (upstreamed future versions)" + patch_type: "conan" diff --git a/recipes/onnxruntime/all/patches/1.14.1-0006-cmake-dependencies.patch b/recipes/onnxruntime/all/patches/1.14.1-0006-cmake-dependencies.patch new file mode 100644 index 0000000000000..68425c3271900 --- /dev/null +++ b/recipes/onnxruntime/all/patches/1.14.1-0006-cmake-dependencies.patch @@ -0,0 +1,29 @@ +--- a/cmake/external/onnxruntime_external_deps.cmake ++++ b/cmake/external/onnxruntime_external_deps.cmake +@@ -115,7 +115,7 @@ + URL_HASH SHA1=${DEP_SHA1_protobuf} + SOURCE_SUBDIR cmake + PATCH_COMMAND ${ONNXRUNTIME_PROTOBUF_PATCH_COMMAND} +- FIND_PACKAGE_ARGS 3.20.2 NAMES Protobuf ++ FIND_PACKAGE_ARGS NAMES Protobuf + ) + set(protobuf_BUILD_TESTS OFF CACHE BOOL "Build protobuf tests" FORCE) + if (CMAKE_SYSTEM_NAME STREQUAL "Android") +@@ -158,7 +158,7 @@ + nlohmann_json + URL ${DEP_URL_json} + URL_HASH SHA1=${DEP_SHA1_json} +- FIND_PACKAGE_ARGS 3.10 NAMES nlohmann_json ++ FIND_PACKAGE_ARGS NAMES nlohmann_json + ) + + #TODO: include clog first +@@ -257,7 +257,7 @@ + GSL + URL ${DEP_URL_microsoft_gsl} + URL_HASH SHA1=${DEP_SHA1_microsoft_gsl} +- FIND_PACKAGE_ARGS 4.0 NAMES Microsoft.GSL ++ FIND_PACKAGE_ARGS NAMES Microsoft.GSL + ) + endif() + diff --git a/recipes/onnxruntime/all/patches/1.15.1-0001-cmake-dependencies.patch b/recipes/onnxruntime/all/patches/1.15.1-0001-cmake-dependencies.patch index 4ebc87b3a4ddc..b7e63a8f17376 100644 --- a/recipes/onnxruntime/all/patches/1.15.1-0001-cmake-dependencies.patch +++ b/recipes/onnxruntime/all/patches/1.15.1-0001-cmake-dependencies.patch @@ -30,6 +30,15 @@ diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onn index 9effd1a2db..a059c28e36 100644 --- a/cmake/external/onnxruntime_external_deps.cmake +++ b/cmake/external/onnxruntime_external_deps.cmake +@@ -152,7 +152,7 @@ + URL ${DEP_URL_protobuf} + URL_HASH SHA1=${DEP_SHA1_protobuf} + PATCH_COMMAND ${ONNXRUNTIME_PROTOBUF_PATCH_COMMAND} +- FIND_PACKAGE_ARGS 3.21.12 NAMES Protobuf ++ FIND_PACKAGE_ARGS NAMES Protobuf + ) + set(protobuf_BUILD_TESTS OFF CACHE BOOL "Build protobuf tests" FORCE) + if (CMAKE_SYSTEM_NAME STREQUAL "Android") @@ -173,6 +173,7 @@ FetchContent_Declare( date URL ${DEP_URL_date} @@ -46,6 +55,24 @@ index 9effd1a2db..a059c28e36 100644 ) set(JSON_BuildTests OFF CACHE INTERNAL "") +@@ -193,7 +195,7 @@ + nlohmann_json + URL ${DEP_URL_json} + URL_HASH SHA1=${DEP_SHA1_json} +- FIND_PACKAGE_ARGS 3.10 NAMES nlohmann_json ++ FIND_PACKAGE_ARGS NAMES nlohmann_json + ) + + #TODO: include clog first +@@ -292,7 +294,7 @@ + GSL + URL ${DEP_URL_microsoft_gsl} + URL_HASH SHA1=${DEP_SHA1_microsoft_gsl} +- FIND_PACKAGE_ARGS 4.0 NAMES Microsoft.GSL ++ FIND_PACKAGE_ARGS NAMES Microsoft.GSL + ) + endif() + @@ -300,6 +302,7 @@ FetchContent_Declare( safeint URL ${DEP_URL_safeint} diff --git a/recipes/onnxruntime/all/patches/1.16.0-0001-cmake-dependencies.patch b/recipes/onnxruntime/all/patches/1.16.0-0001-cmake-dependencies.patch index dacb2b9b27a86..985d9ab12d511 100644 --- a/recipes/onnxruntime/all/patches/1.16.0-0001-cmake-dependencies.patch +++ b/recipes/onnxruntime/all/patches/1.16.0-0001-cmake-dependencies.patch @@ -30,6 +30,15 @@ diff --git a/cmake/external/onnxruntime_external_deps.cmake b/cmake/external/onn index 8e412c7847..0e2482d7de 100644 --- a/cmake/external/onnxruntime_external_deps.cmake +++ b/cmake/external/onnxruntime_external_deps.cmake +@@ -166,7 +166,7 @@ + URL ${DEP_URL_protobuf} + URL_HASH SHA1=${DEP_SHA1_protobuf} + PATCH_COMMAND ${ONNXRUNTIME_PROTOBUF_PATCH_COMMAND} +- FIND_PACKAGE_ARGS 3.21.12 NAMES Protobuf ++ FIND_PACKAGE_ARGS NAMES Protobuf + ) + set(protobuf_BUILD_TESTS OFF CACHE BOOL "Build protobuf tests" FORCE) + if (CMAKE_SYSTEM_NAME STREQUAL "Android") @@ -187,6 +187,7 @@ FetchContent_Declare( date URL ${DEP_URL_date} @@ -46,6 +55,24 @@ index 8e412c7847..0e2482d7de 100644 ) set(JSON_BuildTests OFF CACHE INTERNAL "") +@@ -207,7 +209,7 @@ + nlohmann_json + URL ${DEP_URL_json} + URL_HASH SHA1=${DEP_SHA1_json} +- FIND_PACKAGE_ARGS 3.10 NAMES nlohmann_json ++ FIND_PACKAGE_ARGS NAMES nlohmann_json + ) + + #TODO: include clog first +@@ -306,7 +308,7 @@ + GSL + URL ${DEP_URL_microsoft_gsl} + URL_HASH SHA1=${DEP_SHA1_microsoft_gsl} +- FIND_PACKAGE_ARGS 4.0 NAMES Microsoft.GSL ++ FIND_PACKAGE_ARGS NAMES Microsoft.GSL + ) + endif() + @@ -314,6 +316,7 @@ FetchContent_Declare( safeint URL ${DEP_URL_safeint}