[llvm] r348573 - [CMake] Add support for NO_INSTALL_RPATH argument in llvm_add_library()
Stefan Granitz via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 7 01:12:55 PST 2018
Author: stefan.graenitz
Date: Fri Dec 7 01:12:54 2018
New Revision: 348573
URL: http://llvm.org/viewvc/llvm-project?rev=348573&view=rev
Log:
[CMake] Add support for NO_INSTALL_RPATH argument in llvm_add_library()
Summary:
Allow clients to suppress setup of default RPATHs in designated library targets. This is used in LLDB when emitting liblldb as a framework bundle, which itself doesn't load further RPATH-dependent libraries.
This follows the approach in add_llvm_executable().
Reviewers: aprantl, JDevlieghere, davide, friss
Reviewed By: aprantl
Subscribers: mgorny, lldb-commits, llvm-commits, #lldb
Differential Revision: https://reviews.llvm.org/D55316
Modified:
llvm/trunk/cmake/modules/AddLLVM.cmake
Modified: llvm/trunk/cmake/modules/AddLLVM.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/AddLLVM.cmake?rev=348573&r1=348572&r2=348573&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/AddLLVM.cmake (original)
+++ llvm/trunk/cmake/modules/AddLLVM.cmake Fri Dec 7 01:12:54 2018
@@ -372,12 +372,14 @@ endfunction(set_windows_version_resource
# May specify header files for IDE generators.
# SONAME
# Should set SONAME link flags and create symlinks
+# NO_INSTALL_RPATH
+# Suppress default RPATH settings in shared libraries.
# PLUGIN_TOOL
# The tool (i.e. cmake target) that this plugin will link against
# )
function(llvm_add_library name)
cmake_parse_arguments(ARG
- "MODULE;SHARED;STATIC;OBJECT;DISABLE_LLVM_LINK_LLVM_DYLIB;SONAME"
+ "MODULE;SHARED;STATIC;OBJECT;DISABLE_LLVM_LINK_LLVM_DYLIB;SONAME;NO_INSTALL_RPATH"
"OUTPUT_NAME;PLUGIN_TOOL"
"ADDITIONAL_HEADERS;DEPENDS;LINK_COMPONENTS;LINK_LIBS;OBJLIBS"
${ARGN})
@@ -448,17 +450,19 @@ function(llvm_add_library name)
if(ARG_MODULE)
add_library(${name} MODULE ${ALL_FILES})
- llvm_setup_rpath(${name})
elseif(ARG_SHARED)
add_windows_version_resource_file(ALL_FILES ${ALL_FILES})
add_library(${name} SHARED ${ALL_FILES})
-
- llvm_setup_rpath(${name})
-
else()
add_library(${name} STATIC ${ALL_FILES})
endif()
+ if(NOT ARG_NO_INSTALL_RPATH)
+ if(ARG_MODULE OR ARG_SHARED)
+ llvm_setup_rpath(${name})
+ endif()
+ endif()
+
setup_dependency_debugging(${name} ${LLVM_COMMON_DEPENDS})
if(DEFINED windows_resource_file)
More information about the llvm-commits
mailing list