Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1982,6 +1982,19 @@ else()
"find_dependency(MSTelemetry CONFIG)\n\
")
endif()
if(onnxruntime_USE_TELEMETRY AND APPLE
AND NOT onnxruntime_TELEMETRY_USES_EXTERNAL_PACKAGE)
string(APPEND PROJECT_CONFIG_CONTENT
"if(NOT TARGET MSTelemetry::sqlite_dependency)\n\
add_library(MSTelemetry::sqlite_dependency INTERFACE IMPORTED)\n\
set_property(TARGET MSTelemetry::sqlite_dependency PROPERTY INTERFACE_LINK_LIBRARIES sqlite3)\n\
endif()\n\
if(NOT TARGET MSTelemetry::zlib_dependency)\n\
add_library(MSTelemetry::zlib_dependency INTERFACE IMPORTED)\n\
set_property(TARGET MSTelemetry::zlib_dependency PROPERTY INTERFACE_LINK_LIBRARIES z)\n\
endif()\n\
")
endif()
if(onnxruntime_USE_TELEMETRY AND NOT WIN32 AND NOT APPLE
AND NOT CMAKE_SYSTEM_NAME STREQUAL "Android"
AND NOT onnxruntime_TELEMETRY_USES_EXTERNAL_PACKAGE
Expand Down
2 changes: 1 addition & 1 deletion cmake/deps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@ vulkan_headers;https://codeload.github.com/KhronosGroup/Vulkan-Headers/tar.gz/re
# cpp_client_telemetry (1DS SDK) for cross-platform telemetry on non-Windows platforms.
# Pinned to the stable release plus the ORT-maintained compatibility patch.
cpp_client_telemetry;https://github.com/microsoft/cpp_client_telemetry/archive/refs/tags/v3.10.240.1.zip;96cd290d746b86a31c8e08dd167cf39d390c0134
# Static HTTP transport used by 1DS on non-vcpkg Linux builds.
# Transitive 1DS Linux transport dependencies, retained here for dependency inventory generation.
curl;https://github.com/curl/curl/releases/download/curl-8_21_0/curl-8.21.0.tar.xz;c3b4712175609f1e1662e716efd4fd48901e863d
mbedtls;https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-3.6.7/mbedtls-3.6.7.tar.bz2;e892e98cff90cf7e0736c525bf357626a2513c4c
22 changes: 12 additions & 10 deletions cmake/external/onnxruntime_external_deps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1013,11 +1013,6 @@ if(onnxruntime_USE_TELEMETRY AND NOT WIN32)
message(STATUS "Telemetry: using the vcpkg MSTelemetry::mat package")
set(onnxruntime_TELEMETRY_USES_EXTERNAL_PACKAGE ON)
else()
# Linux packages must not depend on a host libcurl. Build an internal HTTP(S)-only static curl
# before configuring 1DS so its CURL::libcurl reference resolves to the pinned target.
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
include(external/telemetry_linux_http.cmake)
endif()
set(_ort_requested_apple_architectures "${CMAKE_OSX_ARCHITECTURES}")

# Android always uses this path, including vcpkg-based AAR builds. The vcpkg port selects
Expand All @@ -1043,12 +1038,19 @@ if(onnxruntime_USE_TELEMETRY AND NOT WIN32)
if(APPLE)
set(MATSDK_BUILD_APPLE_HTTP ON CACHE BOOL "Build the 1DS Apple HTTP client" FORCE)
endif()
# ORT supplies CURL::libcurl on Linux through its pinned static mbedTLS
# transport. On Apple/Android the SDK selects the native transport.
set(MATSDK_CURL_PROVIDER SYSTEM CACHE STRING "Use ORT's selected 1DS curl target" FORCE)
set(MATSDK_CURL_TLS_BACKEND MBEDTLS CACHE STRING "Use mbedTLS for 1DS curl" FORCE)
set(MATSDK_SQLITE_PROVIDER VENDORED CACHE STRING "Use bundled 1DS SQLite" FORCE)
set(MATSDK_ZLIB_PROVIDER VENDORED CACHE STRING "Use bundled 1DS zlib" FORCE)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(MATSDK_CURL_PROVIDER FETCH CACHE STRING "Build the SDK's pinned curl with mbedTLS" FORCE)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing upstream

else()
set(MATSDK_CURL_PROVIDER SYSTEM CACHE STRING "Use the platform HTTP transport" FORCE)
endif()
if(APPLE)
set(MATSDK_SQLITE_PROVIDER SYSTEM CACHE STRING "Use Apple's system SQLite" FORCE)
set(MATSDK_ZLIB_PROVIDER SYSTEM CACHE STRING "Use Apple's system libz" FORCE)
else()
set(MATSDK_SQLITE_PROVIDER MINIMAL CACHE STRING "Build the SDK's minimal private SQLite" FORCE)
set(MATSDK_ZLIB_PROVIDER VENDORED CACHE STRING "Build the SDK's private zlib" FORCE)
endif()
# BUILD_SHARED_LIBS is a global that ORT's own targets read after this block, and the SDK selects
# mat's library type from it (lib/CMakeLists.txt). Save it, force static for the SDK, restore below.
set(BUILD_SHARED_LIBS_SAVED "${BUILD_SHARED_LIBS}")
Expand Down
298 changes: 0 additions & 298 deletions cmake/external/telemetry_linux_http.cmake

This file was deleted.

21 changes: 6 additions & 15 deletions cmake/onnxruntime_common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -317,21 +317,12 @@ if(onnxruntime_USE_TELEMETRY AND NOT WIN32)
endif()
# Platform-specific system libraries required only for the Apple static-package path.
if(APPLE AND NOT onnxruntime_BUILD_SHARED_LIB)
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
# mat already links the SDK's bundled sqlite3/zlib archives, so no system SQLite is needed here.
# A bare sqlite3 name would reach Xcode as -framework SQLite3, which the iOS SDK does not provide.
target_link_libraries(onnxruntime_common PRIVATE
"-framework CoreFoundation"
"-framework Security"
)
else()
target_link_libraries(onnxruntime_common PRIVATE
"-framework CoreFoundation"
"-framework Security"
z
sqlite3
)
endif()
target_link_libraries(onnxruntime_common PRIVATE
"-framework CoreFoundation"
"-framework Security"
"-lz"
"-lsqlite3"
)
endif()

if (NOT onnxruntime_BUILD_SHARED_LIB)
Expand Down
Loading
Loading