onnxruntime
1db7c25f - Set SOVERSION 1 for Apple builds to match Linux library versioning (#28101)

Commit
21 days ago
Set SOVERSION 1 for Apple builds to match Linux library versioning (#28101) ### Description Include Apple in the existing `SOVERSION 1` block by changing the CMake condition from `if(NOT APPLE AND NOT WIN32)` to `if(NOT WIN32)`. **Before:** macOS install name is `@rpath/libonnxruntime.1.20.0.dylib` — dependents pinned to exact version. **After:** macOS install name is `@rpath/libonnxruntime.1.dylib` — dependents only require major version, matching Linux `libonnxruntime.so.1`. The actual library file remains `libonnxruntime.<VERSION>.dylib`, so existing packaging scripts (`copy_strip_binary.sh`, `mac-cpu-packaging-steps.yml`, `js/node/CMakeLists.txt`) are unaffected. CMake creates the intermediate `libonnxruntime.1.dylib` symlink automatically. ### Motivation and Context On macOS, linking against onnxruntime embeds the full-versioned install name, causing `dlopen` failures when a different patch version is installed: ``` dlopen(dependent.dylib, 0x0001): Library not loaded: @rpath/libonnxruntime.1.20.0.dylib ``` Linux already avoids this via `SOVERSION 1`. The exclusion of Apple from that code path appears unintentional. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tianleiwu <30328909+tianleiwu@users.noreply.github.com>
Author
Parents
Loading