From 30dc91a7073b5cdda7fd3d6fbece28a400fdda81 Mon Sep 17 00:00:00 2001 From: Michal Gorny Date: Wed, 25 Jan 2017 19:33:14 +0000 Subject: [PATCH] [cmake] Fix -rpath-link in stand-alone build Set LLVM_LIBRARY_OUTPUT_INTDIR as expected by llvm_setup_rpath() macro when doing stand-alone builds. This is required to pass correct -rpath-link when linking shared libraries, and therefore ensure that the linker can find dependency libraries correctly during the build. Differential Revision: https://reviews.llvm.org/D29099 llvm-svn: 293078 --- lld/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/lld/CMakeLists.txt b/lld/CMakeLists.txt index 48ac5e038cdb..be424efbbd87 100644 --- a/lld/CMakeLists.txt +++ b/lld/CMakeLists.txt @@ -42,6 +42,7 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) include_directories("${LLVM_BINARY_DIR}/include" ${LLVM_INCLUDE_DIRS}) link_directories(${LLVM_LIBRARY_DIRS}) + set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin) find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)