Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit 0f53352

Browse files
committed
[CMake] Make it possible to set the RPATH in add_lldb_exectable.
Make it possible to pass a build and install RPATH to add_lldb_executable instead of having to call lldb_setup_rpaths after the fact. This fixes a real issue where setting an install RPATH with lldb_setup_rpaths would only affect the symroot installation component. Given that lldb_setup_rpaths sets a target property I would expect this to be orthogonal to installation components. Regardless, it makes sense to integrate this functionality in add_lldb_exectable. git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@375068 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent bf46b76 commit 0f53352

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

cmake/modules/AddLLDB.cmake

+15-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ function(add_lldb_executable name)
148148
cmake_parse_arguments(ARG
149149
"GENERATE_INSTALL"
150150
"INSTALL_PREFIX;ENTITLEMENTS"
151-
"LINK_LIBS;CLANG_LIBS;LINK_COMPONENTS"
151+
"LINK_LIBS;CLANG_LIBS;LINK_COMPONENTS;BUILD_RPATH;INSTALL_RPATH"
152152
${ARGN}
153153
)
154154

@@ -175,13 +175,26 @@ function(add_lldb_executable name)
175175
endif()
176176
set_target_properties(${name} PROPERTIES FOLDER "lldb executables")
177177

178+
if (ARG_BUILD_RPATH)
179+
set_target_properties(${name} PROPERTIES BUILD_RPATH "${ARG_BUILD_RPATH}")
180+
endif()
181+
182+
if (ARG_INSTALL_RPATH)
183+
set_target_properties(${name} PROPERTIES
184+
BUILD_WITH_INSTALL_RPATH OFF
185+
INSTALL_RPATH "${ARG_INSTALL_RPATH}")
186+
endif()
187+
178188
if(ARG_GENERATE_INSTALL)
179189
set(install_dest bin)
180190
if(ARG_INSTALL_PREFIX)
181191
set(install_dest ${ARG_INSTALL_PREFIX})
182192
endif()
183193
install(TARGETS ${name} COMPONENT ${name}
184-
RUNTIME DESTINATION ${install_dest})
194+
RUNTIME DESTINATION ${install_dest}
195+
LIBRARY DESTINATION ${install_dest}
196+
BUNDLE DESTINATION ${install_dest}
197+
FRAMEWORK DESTINATION ${install_dest})
185198
if (NOT CMAKE_CONFIGURATION_TYPES)
186199
add_llvm_install_targets(install-${name}
187200
DEPENDS ${name}

0 commit comments

Comments
 (0)