[PR #1089] CMake: install relocatable shared libs for macOS #1638

Closed
opened 2026-01-29 20:55:05 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/google/brotli/pull/1089

State: closed
Merged: Yes


Remove hardcoded CMAKE_INSTALL_NAME_DIR, so that it's @rpath by default (default CMake behavior when cmake_minimum_required() is at least 3.0). set(CMAKE_MACOS_RPATH TRUE) is useless, it's the default value for CMake if cmake_minimum_required() is at least 3.0 as well, no need to hardcode this value.

It reverts https://github.com/google/brotli/pull/976 (hardcoding CMAKE_INSTALL_NAME_DIR is bad practice).

If someone wants to change this behavior for a specific reason, CMAKE_INSTALL_NAME_DIR can be injected externally, no need to patch build files.

**Original Pull Request:** https://github.com/google/brotli/pull/1089 **State:** closed **Merged:** Yes --- Remove hardcoded `CMAKE_INSTALL_NAME_DIR`, so that it's `@rpath` by default (default CMake behavior when cmake_minimum_required() is at least 3.0). `set(CMAKE_MACOS_RPATH TRUE)` is useless, it's the default value for CMake if cmake_minimum_required() is at least 3.0 as well, no need to hardcode this value. It reverts https://github.com/google/brotli/pull/976 (hardcoding `CMAKE_INSTALL_NAME_DIR` is bad practice). If someone wants to change this behavior for a specific reason, `CMAKE_INSTALL_NAME_DIR` can be injected externally, no need to patch build files.
claunia added the pull-request label 2026-01-29 20:55:05 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#1638