From d5b992271c8dd0f0dca86e41dcf9319d35d39ee5 Mon Sep 17 00:00:00 2001 From: Simon Evans Date: Wed, 28 Nov 2018 21:56:20 +0000 Subject: [PATCH] plutil: Fix RUNPATH and file permissions of installed binary --- CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d9db3fae9..0b872d7cc4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,9 @@ include(SwiftSupport) include(GNUInstallDirs) include(ExternalProject) +string(TOLOWER ${CMAKE_SYSTEM_NAME} swift_os) +get_swift_host_arch(swift_arch) + ExternalProject_Add(CoreFoundation SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/CoreFoundation @@ -286,6 +289,7 @@ add_swift_executable(plutil ${libdispatch_ldflags} -lFoundation ${Foundation_INTERFACE_LIBRARIES} + -Xlinker;-rpath;-Xlinker;"\\\$\$ORIGIN/../lib/swift/${swift_os}" SWIFT_FLAGS -DDEPLOYMENT_RUNTIME_SWIFT ${deployment_enable_libdispatch} @@ -477,9 +481,6 @@ if(ENABLE_TESTING) ${CMAKE_CURRENT_BINARY_DIR}/TestFoundation/xdgTestHelper${CMAKE_EXECUTABLE_SUFFIX}) endif() -string(TOLOWER ${CMAKE_SYSTEM_NAME} swift_os) -get_swift_host_arch(swift_arch) - # TODO(compnerd) honour lib vs lib64 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/swift/Foundation.swiftdoc @@ -507,7 +508,7 @@ install(FILES CoreFoundation/Base.subproj/module.map DESTINATION lib/swift/CoreFoundation) -install(FILES +install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/plutil DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})