From 1cbe9e1e7336309347f42822124d78b74d79ed58 Mon Sep 17 00:00:00 2001 From: Fabrice de Gans Date: Mon, 18 Nov 2024 16:41:54 -0800 Subject: [PATCH] [cmake] Set up rpath for macOS This set up the `INSTALL_RPATH` property for the `swift-format` binary, resulting in a binary that is directly usable post-installation. --- Sources/swift-format/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/swift-format/CMakeLists.txt b/Sources/swift-format/CMakeLists.txt index 9ae9603e1..a9b58c374 100644 --- a/Sources/swift-format/CMakeLists.txt +++ b/Sources/swift-format/CMakeLists.txt @@ -33,4 +33,7 @@ target_link_libraries(swift-format PRIVATE SwiftParser SwiftSyntax) +set_target_properties(swift-format PROPERTIES + INSTALL_RPATH "$<$:@executable_path/../lib/swift/macosx;@executable_path/../lib/swift/host;@executable_path/../lib/swift/host/compiler>") + _install_target(swift-format)