[Lldb-commits] [lldb] r375068 - [CMake] Make it possible to set the RPATH in add_lldb_exectable.
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Wed Oct 16 17:50:40 PDT 2019
Author: jdevlieghere
Date: Wed Oct 16 17:50:39 2019
New Revision: 375068
URL: http://llvm.org/viewvc/llvm-project?rev=375068&view=rev
Log:
[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.
Modified:
lldb/trunk/cmake/modules/AddLLDB.cmake
Modified: lldb/trunk/cmake/modules/AddLLDB.cmake
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=375068&r1=375067&r2=375068&view=diff
==============================================================================
--- lldb/trunk/cmake/modules/AddLLDB.cmake (original)
+++ lldb/trunk/cmake/modules/AddLLDB.cmake Wed Oct 16 17:50:39 2019
@@ -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}
More information about the lldb-commits
mailing list