Modernize CMake embedding and self-contained dependencies - #1511
Conversation
Expose the same MSTelemetry::mat target name for build-tree add_subdirectory/FetchContent consumers so downstream projects can link one target regardless of vcpkg/install vs source embedding. Files changed: - lib/CMakeLists.txt: add MSTelemetry::mat build-tree alias. - CMakeLists.txt, lib/CMakeLists.txt: add optional MATSDK_CURL_TARGET, MATSDK_SQLITE_TARGET, and MATSDK_ZLIB_TARGET overrides for non-vcpkg superbuilds, with a WIN32 zlib guard for the existing act_z_* header path. - docs/embedding-with-cmake.md: document source embedding and dependency target overrides. - tests/embedding/CMakeLists.txt: add add_subdirectory smoke project linking MSTelemetry::mat. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b12c5862-01e3-45e4-bf91-6389c20cae41
Allow source-embedding consumers to set MATSDK_CURL_PROVIDER=FETCH so 1DS downloads and builds a pinned static curl dependency on Linux, matching the ORT GenAI model. Details: - Add MATSDK_CURL_PROVIDER and MATSDK_CURL_TLS_BACKEND options, defaulting to package discovery and mbedTLS for fetched curl. - Add pinned curl and mbedTLS URL/SHA cache variables. - Add cmake/MatsdkFetchCurl.cmake to build HTTP(S)-only static curl with mbedTLS or OpenSSL. - Document fetched curl and dependency-target override usage for non-vcpkg embedding. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b12c5862-01e3-45e4-bf91-6389c20cae41
There was a problem hiding this comment.
Pull request overview
This PR improves the CMake “source embedding” experience (via add_subdirectory() / FetchContent) so consumers can link the SDK through the same MSTelemetry::mat target name used by vcpkg/installed workflows, and optionally obtain a self-contained non-vcpkg libcurl on Linux.
Changes:
- Add a build-tree
MSTelemetry::matalias for the in-treemattarget. - Add non-vcpkg dependency override cache variables (
MATSDK_CURL_TARGET,MATSDK_SQLITE_TARGET,MATSDK_ZLIB_TARGET) and a Linux-onlyMATSDK_CURL_PROVIDER=FETCHpath with selectable TLS backend. - Add embedding documentation and a CMake smoke project that links
MSTelemetry::matviaadd_subdirectory().
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
CMakeLists.txt |
Adds cache variables and validation for non-vcpkg dependency overrides and fetched-curl selection. |
lib/CMakeLists.txt |
Adds build-tree MSTelemetry::mat alias and wires SQLite/zlib override targets into platform link logic. |
cmake/MatsdkFetchCurl.cmake |
Implements Linux-only FetchContent build of pinned static curl (+ optional mbedTLS/OpenSSL). |
docs/embedding-with-cmake.md |
Documents embedding with MSTelemetry::mat and the non-vcpkg override/fetch options. |
tests/embedding/CMakeLists.txt |
Adds an embedding smoke CMake project that links MSTelemetry::mat. |
Comments suppressed due to low confidence (1)
cmake/MatsdkFetchCurl.cmake:116
- FetchContent URL_HASH uses SHA1 for the pinned curl download. SHA1 is cryptographically weak for verifying downloaded archives; prefer SHA256 (or stronger) to reduce the risk of a collision-based substitution.
FetchContent_Declare(
matsdk_curl
URL ${MATSDK_CURL_URL}
URL_HASH SHA1=${MATSDK_CURL_SHA1})
FetchContent_MakeAvailable(matsdk_curl)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
CMakeLists.txt:379
- The fetched dependency integrity pins use SHA1 (MATSDK_MBEDTLS_SHA1). SHA1 is collision-prone; prefer SHA256 (or stronger) for FetchContent URL_HASH to reduce supply-chain risk. This change will require updating both the cache variable(s) and the URL_HASH algorithm in MatsdkFetchCurl.cmake.
set(MATSDK_MBEDTLS_URL "https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-3.6.7/mbedtls-3.6.7.tar.bz2" CACHE STRING
"URL for the mbedTLS dependency used by MATSDK_CURL_PROVIDER=FETCH and MATSDK_CURL_TLS_BACKEND=MBEDTLS")
set(MATSDK_MBEDTLS_SHA1 "e892e98cff90cf7e0736c525bf357626a2513c4c" CACHE STRING
"SHA1 for MATSDK_MBEDTLS_URL")
Use SHA256 URL_HASH pins for fetched curl and mbedTLS instead of SHA1, matching FetchContent's stronger integrity checks. Do not override CURL_CA_BUNDLE/CURL_CA_PATH to none; allow fetched curl to use normal CA discovery so default TLS verification can succeed without every consumer supplying CAINFO. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b12c5862-01e3-45e4-bf91-6389c20cae41
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (5)
cmake/MatsdkFetchCurl.cmake:73
- Same as above for the ON toggles: these should be set as CACHE entries so the fetched curl/mbedTLS builds deterministically pick them up (especially options like BUILD_STATIC_LIBS / HTTP_ONLY).
foreach(option IN ITEMS
BUILD_STATIC_LIBS
DISABLE_PACKAGE_CONFIG_AND_INSTALL
CURL_DISABLE_INSTALL
HTTP_ONLY
CURL_DISABLE_ALTSVC
CURL_DISABLE_HSTS
CURL_DISABLE_COOKIES
CURL_DISABLE_NETRC
CURL_DISABLE_MIME
CURL_DISABLE_DOH
CURL_DISABLE_AWS
CURL_DISABLE_BEARER_AUTH
CURL_DISABLE_DIGEST_AUTH
CURL_DISABLE_KERBEROS_AUTH
CURL_DISABLE_NEGOTIATE_AUTH)
set(${option} ON)
endforeach()
cmake/MatsdkFetchCurl.cmake:54
- The feature/option toggles are set as normal variables (e.g.,
set(${option} OFF)), which may not reliably control the fetched subprojects'option()/CACHE settings across all CMake versions and scopes. To ensure curl/mbedTLS actually build with the intended minimal feature set, set these as CACHE entries (with FORCE) beforeFetchContent_MakeAvailable().
This issue also appears on line 56 of the same file.
foreach(option IN ITEMS
BUILD_SHARED_LIBS
BUILD_TESTING
ENABLE_PROGRAMS
ENABLE_TESTING
GEN_FILES
UNSAFE_BUILD
INSTALL_MBEDTLS_HEADERS
MBEDTLS_FATAL_WARNINGS
USE_SHARED_MBEDTLS_LIBRARY
LINK_WITH_PTHREAD
BUILD_CURL_EXE
BUILD_EXAMPLES
BUILD_LIBCURL_DOCS
BUILD_MISC_DOCS
ENABLE_CURL_MANUAL
CURL_ENABLE_EXPORT_TARGET
CURL_USE_OPENSSL
CURL_USE_PKGCONFIG
CURL_USE_CMAKECONFIG
CURL_ZLIB
CURL_BROTLI
CURL_ZSTD
USE_LIBIDN2
CURL_USE_LIBPSL
CURL_USE_LIBSSH2
CURL_USE_LIBSSH
CURL_USE_GSSAPI
CURL_USE_GSASL
USE_NGHTTP2
USE_NGTCP2
USE_QUICHE
ENABLE_ARES
ENABLE_UNIX_SOCKETS)
set(${option} OFF)
endforeach()
CMakeLists.txt:391
MATSDK_CURL_TLS_BACKENDis validated even whenMATSDK_CURL_PROVIDERis PACKAGE (or curl isn't used on the current platform). This makes otherwise-valid configurations fail due to an unused setting. Gate the validation onMATSDK_CURL_PROVIDER=FETCH.
string(TOUPPER "${MATSDK_CURL_TLS_BACKEND}" MATSDK_CURL_TLS_BACKEND_UPPER)
if(NOT MATSDK_CURL_TLS_BACKEND_UPPER STREQUAL "MBEDTLS" AND NOT MATSDK_CURL_TLS_BACKEND_UPPER STREQUAL "OPENSSL")
message(FATAL_ERROR "MATSDK_CURL_TLS_BACKEND must be MBEDTLS or OPENSSL; got '${MATSDK_CURL_TLS_BACKEND}'.")
endif()
CMakeLists.txt:393
- The
MATSDK_*_TARGEToverrides are described as applying to non-vcpkg builds, but they are validated unconditionally. This can make vcpkg configurations fail due to unused override variables. Consider gating this validation onNOT MATSDK_USE_VCPKG_DEPS.
if(${_matsdk_dependency_target_var} AND NOT TARGET "${${_matsdk_dependency_target_var}}")
docs/embedding-with-cmake.md:26
- The docs mention
MATSDK_CURL_PROVIDER=FETCHbut don’t note that it will fail if the consuming build already definesCURL::libcurl(e.g., viafind_package(CURL)), because the embedded curl build needs to create that target name. Calling this out will save consumers time when integrating into larger superbuilds.
When the CPP11 PAL uses the curl HTTP transport outside vcpkg, the SDK normally
calls `find_package(CURL)` and links `CURL::libcurl` when that imported target is
available. On Linux, set `MATSDK_CURL_PROVIDER=FETCH` to let the SDK download and
build a pinned static curl dependency instead:
Select HTTP/2 only when the linked curl runtime advertises support and otherwise request HTTP/1.1, so minimal fetched curl builds do not force an unavailable protocol. Check curl option/getinfo failures, preserve constructor configuration errors, and use the correct response-code/socket types before sending. Also fix the conventional calloc argument ordering in EventProperties while bundling small correctness work with the larger embedding PR. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b12c5862-01e3-45e4-bf91-6389c20cae41
Bundle the remaining embedding work into PR microsoft#1511 so downstream projects can consume one stable target without source rewrites or platform-specific dependency glue. Key changes: - use standard CMAKE_OSX_* architecture/sysroot/deployment settings with legacy input compatibility; - add canonical MATSDK_* build options and explicit STATIC/SHARED library selection; - make warnings, Werror, ARC, visibility, and dead-strip policy target-local; - add explicit SYSTEM/MINIMAL/VENDORED SQLite and zlib providers with self-contained static installs; - preserve static/dynamic and pinned-source vcpkg compatibility; - add FetchContent consumer CI for Linux, Windows, macOS universal/arm64, iOS device/simulator, and Android under warnings-as-errors; - update build scripts/docs and route legacy installation through cmake --install. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b12c5862-01e3-45e4-bf91-6389c20cae41
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (3)
lib/http/HttpClient_Curl.hpp:317
CURLOPT_WRITEFUNCTIONexpects a function pointer; passing it as avoid*(via(void *)&WriteVectorCallback) is undefined behavior on platforms where data pointers and function pointers differ. Prefer passing a function-pointer type (e.g.,curl_write_callback) and pass data pointers asvoid*explicitly.
else if (!SetOption(CURLOPT_WRITEFUNCTION, (void *)&WriteVectorCallback)
|| !SetOption(CURLOPT_HEADERDATA, (void *)&respHeaders)
|| !SetOption(CURLOPT_WRITEDATA, (void *)&respBody))
{
cmake/MatsdkFetchCurl.cmake:54
- The curl/mbedTLS option toggles are set with plain
set(...)inside a CMakefunction(). FetchContent builds the dependency viaadd_subdirectory(), which typically does not inherit function-scope variables, so these toggles may be ignored and the fetched curl build could end up using its defaults (shared libs, extra protocols/features, installs, etc.). Consider switching to a mechanism guaranteed to affect the dependency configure (e.g., cache variables scoped/restored around the FetchContent call, or a wrapper toolchain/options file).
foreach(option IN ITEMS
BUILD_SHARED_LIBS
BUILD_TESTING
ENABLE_PROGRAMS
ENABLE_TESTING
GEN_FILES
UNSAFE_BUILD
INSTALL_MBEDTLS_HEADERS
MBEDTLS_FATAL_WARNINGS
USE_SHARED_MBEDTLS_LIBRARY
LINK_WITH_PTHREAD
BUILD_CURL_EXE
BUILD_EXAMPLES
BUILD_LIBCURL_DOCS
BUILD_MISC_DOCS
ENABLE_CURL_MANUAL
CURL_ENABLE_EXPORT_TARGET
CURL_USE_OPENSSL
CURL_USE_PKGCONFIG
CURL_USE_CMAKECONFIG
CURL_ZLIB
CURL_BROTLI
CURL_ZSTD
USE_LIBIDN2
CURL_USE_LIBPSL
CURL_USE_LIBSSH2
CURL_USE_LIBSSH
CURL_USE_GSSAPI
CURL_USE_GSASL
USE_NGHTTP2
USE_NGTCP2
USE_QUICHE
ENABLE_ARES
ENABLE_UNIX_SOCKETS)
set(${option} OFF)
endforeach()
lib/http/HttpClient_Curl.hpp:240
- This guard can leak a previous successful HTTP status code into the
!curl || !m_isConfiguredfailure path (because it only overwritesreswhen it is exactlyCURLE_OK). That can makeSend()report success even though it immediately fails initialization. Consider overridingreswhen it isCURLE_OKor when it looks like an HTTP status code (>=100), while still preserving a prior CURL error from construction/configuration.
if(!curl || !m_isConfigured)
{
if (res == CURLE_OK)
{
res = CURLE_FAILED_INIT;
}
DispatchEvent(OnSendFailed);
Pass curl_write_callback function pointers instead of converting function pointers to void*, and use void* only for callback userdata. This preserves portability on architectures where function and data pointers differ. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b12c5862-01e3-45e4-bf91-6389c20cae41
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
lib/http/HttpClient_Curl.hpp:318
Send()attempts to collect response headers intorespHeadersviaCURLOPT_HEADERDATA, but noCURLOPT_HEADERFUNCTIONis set. In that case, libcurl will not userespHeaders(andGetResponseHeaders()will always return empty). Set an explicit header callback (the existingWriteVectorCallbackworks) so therespHeadersbuffer is actually populated.
else if (!SetOption(CURLOPT_WRITEFUNCTION,
static_cast<curl_write_callback>(&WriteVectorCallback))
|| !SetOption(CURLOPT_HEADERDATA, static_cast<void*>(&respHeaders))
|| !SetOption(CURLOPT_WRITEDATA, static_cast<void*>(&respBody)))
Substitute a build-platform boolean that is always TRUE or FALSE so generated package configs never depend on an undefined APPLE variable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b12c5862-01e3-45e4-bf91-6389c20cae41
Extract the Apple-system-SQLite/zlib imported-target logic (previously copy-pasted between CMakeLists.txt and cmake/MSTelemetryConfig.cmake.in) into a single shared cmake/MatsdkAppleSystemDeps.cmake helper, included from both files and installed alongside MSTelemetryConfig.cmake. This is exactly the class of bug fixed in the previous commit: the two copies had drifted out of sync (one had GLOBAL, one did not) because there was no structural mechanism preventing divergence. With one shared definition, that can no longer happen. Validated: - Windows FetchContent embedding build/run: 10/10 passed. - Linux static package build/install: MatsdkAppleSystemDeps.cmake installs alongside MSTelemetryConfig.cmake in lib/cmake/MSTelemetry/. - Standalone CMake project simulating the generated Apple-branch install config: SQLite::SQLite3 and ZLIB::ZLIB are created with IMPORTED_GLOBAL=TRUE and the correct underlying link libraries. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b12c5862-01e3-45e4-bf91-6389c20cae41
Apply the simplest-design-while-kind-to-users principle to three legacy build inputs that predate this PR by more than three months: - USE_CURL (Android): translated to MATSDK_ANDROID_HTTP_CLIENT=CURL when the canonical option was not already set explicitly. This is a real functional switch for deliberate Android-curl consumers (not just a renamed knob), and the translation is a handful of lines following the existing matsdk_bool_option pattern, so it is cheap to keep working. - INSTALL_LIB_DIR and BUILD_STATIC_SQLITE: detected and reported via message(DEPRECATION ...) with no behavioral translation. Both are narrow, internal packaging-path/linkage knobs whose old semantics do not map cleanly onto the new GNUInstallDirs layout or MATSDK_SQLITE_PROVIDER model, so silently reinterpreting them would add real complexity for very few users. Instead of silently ignoring them (CMake's default for an unrecognized -D), an old script now gets an explicit, actionable message instead of a silent layout/linkage change. - The Android AAR CMake target name change (maesdk -> mat, with the .so OUTPUT_NAME already preserved as maesdk) is intentionally NOT given a compatibility target: that target was never installed/exported and was purely internal wiring within one subdirectory, so it was never a public interface external code could reference. Validated: -DUSE_CURL=ON on an Android configure resolves MATSDK_ANDROID_HTTP_CLIENT to CURL and requires curl as expected; -DINSTALL_LIB_DIR=... -DBUILD_STATIC_SQLITE=ON on a Linux configure prints both deprecation warnings and still configures successfully. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: b12c5862-01e3-45e4-bf91-6389c20cae41
Share shell and CMake dependency wiring across native, iOS, test, and package builds while preserving provider-specific behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 741fc486-3743-4095-b44d-d65afa131d75
Ensure vcpkg-built Apple libraries match the consumer deployment target and avoid linker warnings. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5f341bc5-f8ae-4259-b03b-8eeb87c06837
Propagate the resolved iOS sysroot to embedding builds and keep Apple vendored targets compatible with strict warning settings. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5f341bc5-f8ae-4257-b03b-8eeb87c06837
Remove legacy Apple architecture, platform, and deployment-target inputs so standalone scripts and embedding consumers share CMAKE_OSX_* configuration. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5f341bc5-f8ae-4257-b03b-8eeb87c06837
# Conflicts: # CMakeLists.txt # build-ios.sh # build.sh # lib/CMakeLists.txt # tools/ports/cpp-client-telemetry/portfile.cmake
Preserve repeated package dependency configuration and cover curl response header/body capture with a local test server. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5f341bc5-f8ae-4257-b03b-8eeb87c06837
Do not claim DES ECB support through a stale CMake hint; curl digest authentication is disabled and capability detection should remain authoritative. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5f341bc5-f8ae-4257-b03b-8eeb87c06837
Keep MSVC from receiving GCC-only warning flags and support both CMake SQLite target spellings used by Apple and legacy consumers. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 741fc486-3743-4095-b44d-d65afa131d75
Preserve quoted and escaped option values while removing eval from the shared build wrapper. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 741fc486-3743-4095-b44d-d65afa131d75
Avoid loading the Apple system-library helper on non-Apple configurations while retaining lazy package-consumer loading. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 741fc486-3743-4095-b44d-d65afa131d75
Apply -fdata-sections only to GCC and non-Apple Clang toolchains. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 741fc486-3743-4095-b44d-d65afa131d75
Treat SQLite3::SQLite3 as an existing system provider before selecting bundled SQLite. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 741fc486-3743-4095-b44d-d65afa131d75
Fail during configuration before selecting Android-only Room sources on other platforms. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 741fc486-3743-4095-b44d-d65afa131d75
Use the documented iOS 13 minimum consistently in the wrapper, vcpkg port, and consumer smoke test. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 741fc486-3743-4095-b44d-d65afa131d75
Install Apple system dependency helpers only in Apple packages and remove unsolicited legacy-option diagnostics. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 741fc486-3743-4095-b44d-d65afa131d75
Remove the legacy option translation helper and document the canonical Android Room option. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 741fc486-3743-4095-b44d-d65afa131d75
Preserve the canonical CMake dependency refactor while incorporating upstream CI and runtime fixes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Initialize only the accessible googletest submodule while preserving upstream checkout pins. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use the merged matsdk_test_config target instead of the removed test include target. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Pass the plain FetchContent targets to curl instead of nonexistent MbedTLS namespace aliases. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Avoid aliasing an existing CMake alias target during source embedding configuration. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Curl's MbedTLS integration links namespaced targets during try_compile; alias the fetched static targets before configuring curl. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Problem
Source embedding through
add_subdirectory()orFetchContentshould let ORT /ORT GenAI-style consumers link one stable target without patching 1DS sources,
manually wiring dependencies, inheriting SDK warning flags, or using custom
platform controls where CMake already has standard ones.
Changes
Standard CMake surface
MSTelemetry::matin both build and installed package trees.BUILD_SHARED_LIBSfor static/shared selection.MATSDK_BUILD_*options while retaining existingBUILD_*inputs as compatibility aliases.
CMAKE_OSX_ARCHITECTURES,CMAKE_OSX_SYSROOT, andCMAKE_OSX_DEPLOYMENT_TARGET; legacy Apple inputs are translated at the edge.existing 3.15 floor; preset wrappers require CMake 3.21.
Explicit dependency providers
MATSDK_SQLITE_PROVIDER=AUTO|SYSTEM|MINIMAL|VENDORED|NONE.MATSDK_ZLIB_PROVIDER=AUTO|SYSTEM|VENDORED.MATSDK_CURL_PROVIDER=SYSTEM|FETCHandMATSDK_CURL_TLS_BACKEND=MBEDTLS|OPENSSL.CURL::libcurl,SQLite::SQLite3, andZLIB::ZLIBtargets,including targets supplied by a parent project.
with proxy, IPv6, system CA discovery, PIC, and hidden symbols.
targets are
GLOBALand their creation is shared (cmake/MatsdkAppleSystemDeps.cmake)between the build-time and installed-package configs, so a consumer that
calls
find_package(MSTelemetry)in one directory and linksMSTelemetry::matfrom a sibling directory can still resolve them, and thetwo configs cannot drift out of sync with each other.
Legacy input handling
USE_CURL(Android) still works: translated toMATSDK_ANDROID_HTTP_CLIENT=CURLwhen the canonical option isn't set.INSTALL_LIB_DIRandBUILD_STATIC_SQLITEare narrow, internal knobs whoseold semantics don't map cleanly onto the new layout/provider model; rather
than silently reinterpreting or silently ignoring them, setting either now
prints an explicit
DEPRECATIONmessage pointing at the replacement.maesdk->mat) has no compatibilitytarget: it was never installed/exported, so it was never a public interface.
Android and target isolation
mattarget insteadof maintaining a second source graph.
opt-ins through the Android curl vcpkg features.
MSTelemetry_ANDROID_JAVA_SOURCE_DIR.dead-strip policy target-local so parent and vendored targets do not inherit it.
/usr/local/includepaths from cross-compiles.Correctness and consumer coverage
callocargument ordering.Windows, macOS arm64/universal, iOS device/simulator, and Android API 23.
the existing Windows/Linux/macOS/iOS/Android vcpkg matrix.
Validation
find_package(MSTelemetry); runtime checks passed 10/10.were installed, and an installed-package native consumer linked.
created the Apple-system
SQLite::SQLite3/ZLIB::ZLIBimported targetswithout
GLOBAL, inconsistent with the build-time config's identicalconstruct. A consumer calling
find_package(MSTelemetry)in one directoryand linking
MSTelemetry::matfrom a sibling directory would have failed toresolve them at generate time. Fixed, and the target-creation logic was
deduplicated into a shared, installed cmake helper so the two configs cannot
diverge again. Re-verified: Windows FetchContent build/run 10/10, Linux
static install confirms the shared helper installs alongside
MSTelemetryConfig.cmake, and a standalone simulation of the generatedApple-branch config confirms both targets are created with
IMPORTED_GLOBAL=TRUE. Final review pass reported no further findings.