Skip to content

Commit c54a56d

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 (cherry picked from commit 0f53352cb22da3e0bd5e4d4272e9849e9883f11e) apple-llvm-split-commit: ee50d1c3beffa30ba66e7353c80a590ed8ab9e6a apple-llvm-split-dir: lldb/
1 parent 7bb3757 commit c54a56d

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

lldb/cmake/modules/AddLLDB.cmake

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function(add_lldb_executable name)
142142
cmake_parse_arguments(ARG
143143
"GENERATE_INSTALL"
144144
"INSTALL_PREFIX;ENTITLEMENTS"
145-
"LINK_LIBS;LINK_COMPONENTS"
145+
"LINK_LIBS;LINK_COMPONENTS;BUILD_RPATH;INSTALL_RPATH"
146146
${ARGN}
147147
)
148148

@@ -164,13 +164,26 @@ function(add_lldb_executable name)
164164
target_link_libraries(${name} PRIVATE ${ARG_LINK_LIBS})
165165
set_target_properties(${name} PROPERTIES FOLDER "lldb executables")
166166

167+
if (ARG_BUILD_RPATH)
168+
set_target_properties(${name} PROPERTIES BUILD_RPATH "${ARG_BUILD_RPATH}")
169+
endif()
170+
171+
if (ARG_INSTALL_RPATH)
172+
set_target_properties(${name} PROPERTIES
173+
BUILD_WITH_INSTALL_RPATH OFF
174+
INSTALL_RPATH "${ARG_INSTALL_RPATH}")
175+
endif()
176+
167177
if(ARG_GENERATE_INSTALL)
168178
set(install_dest bin)
169179
if(ARG_INSTALL_PREFIX)
170180
set(install_dest ${ARG_INSTALL_PREFIX})
171181
endif()
172182
install(TARGETS ${name} COMPONENT ${name}
173-
RUNTIME DESTINATION ${install_dest})
183+
RUNTIME DESTINATION ${install_dest}
184+
LIBRARY DESTINATION ${install_dest}
185+
BUNDLE DESTINATION ${install_dest}
186+
FRAMEWORK DESTINATION ${install_dest})
174187
if (NOT CMAKE_CONFIGURATION_TYPES)
175188
add_llvm_install_targets(install-${name}
176189
DEPENDS ${name}

0 commit comments

Comments
 (0)