if(NOT ARG_NO_INSTALL_RPATH)
llvm_setup_rpath(${name})
- elseif (LLVM_LOCAL_RPATH)
- set_target_properties(${name} PROPERTIES
- BUILD_WITH_INSTALL_RPATH On
- INSTALL_RPATH "${LLVM_LOCAL_RPATH}")
+ else()
+ # Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set.
+ if("${CMAKE_BUILD_RPATH}" STREQUAL "")
+ set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH ON)
+ endif()
+
+ set_property(TARGET ${name} PROPERTY INSTALL_RPATH "${LLVM_LOCAL_RPATH}")
endif()
if(DEFINED windows_resource_file)
return()
endif()
+ # Enable BUILD_WITH_INSTALL_RPATH unless CMAKE_BUILD_RPATH is set.
+ if("${CMAKE_BUILD_RPATH}" STREQUAL "")
+ set_property(TARGET ${name} PROPERTY BUILD_WITH_INSTALL_RPATH ON)
+ endif()
+
set_target_properties(${name} PROPERTIES
- BUILD_WITH_INSTALL_RPATH On
INSTALL_RPATH "${_install_rpath}"
${_install_name_dir})
endfunction()