diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-10-17 00:50:39 +0000 |
|---|---|---|
| committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-10-17 00:50:39 +0000 |
| commit | eb1bbcec08d2d22bbcc55be6cb05476b617c96cf (patch) | |
| tree | 9582386b2563d8f39ab237b47b16c586800ed35e /lldb/cmake/modules | |
| parent | 329e748c8c3b0fd3942cb1dafa9e4d0bb0aea8a4 (diff) | |
| download | bcm5719-llvm-eb1bbcec08d2d22bbcc55be6cb05476b617c96cf.tar.gz bcm5719-llvm-eb1bbcec08d2d22bbcc55be6cb05476b617c96cf.zip | |
[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.
llvm-svn: 375068
Diffstat (limited to 'lldb/cmake/modules')
| -rw-r--r-- | lldb/cmake/modules/AddLLDB.cmake | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lldb/cmake/modules/AddLLDB.cmake b/lldb/cmake/modules/AddLLDB.cmake index ef1e1df4c68..5fcf6774946 100644 --- a/lldb/cmake/modules/AddLLDB.cmake +++ b/lldb/cmake/modules/AddLLDB.cmake @@ -148,7 +148,7 @@ function(add_lldb_executable name) cmake_parse_arguments(ARG "GENERATE_INSTALL" "INSTALL_PREFIX;ENTITLEMENTS" - "LINK_LIBS;CLANG_LIBS;LINK_COMPONENTS" + "LINK_LIBS;CLANG_LIBS;LINK_COMPONENTS;BUILD_RPATH;INSTALL_RPATH" ${ARGN} ) @@ -175,13 +175,26 @@ function(add_lldb_executable name) endif() set_target_properties(${name} PROPERTIES FOLDER "lldb executables") + if (ARG_BUILD_RPATH) + set_target_properties(${name} PROPERTIES BUILD_RPATH "${ARG_BUILD_RPATH}") + endif() + + if (ARG_INSTALL_RPATH) + set_target_properties(${name} PROPERTIES + BUILD_WITH_INSTALL_RPATH OFF + INSTALL_RPATH "${ARG_INSTALL_RPATH}") + endif() + if(ARG_GENERATE_INSTALL) set(install_dest bin) if(ARG_INSTALL_PREFIX) set(install_dest ${ARG_INSTALL_PREFIX}) endif() install(TARGETS ${name} COMPONENT ${name} - RUNTIME DESTINATION ${install_dest}) + RUNTIME DESTINATION ${install_dest} + LIBRARY DESTINATION ${install_dest} + BUNDLE DESTINATION ${install_dest} + FRAMEWORK DESTINATION ${install_dest}) if (NOT CMAKE_CONFIGURATION_TYPES) add_llvm_install_targets(install-${name} DEPENDS ${name} |

