[CMake]Use LLVM_LIBRARY_DIR for lib path.

Summary:
This makes sure the correct lib path is being used when `CMAKE_CFG_INTDIR` or
`LLVM_LIBDIR_SUFFIX` is set.

Reviewers: beanz

Subscribers: mgorny, srhines, pirama, llvm-commits

Differential Revision: https://reviews.llvm.org/D35318

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307985 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Leo Li 2017-07-14 00:35:21 +00:00
parent ac4ebc9acc
commit c0e7d7e6da

View File

@ -30,7 +30,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_SOURCE_DIR}/../cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules"
"${LLVM_BINARY_DIR}/lib/cmake/llvm"
"${LLVM_LIBRARY_DIR}/cmake/llvm"
)
# Some of the runtimes will conditionally use the compiler-rt sanitizers
@ -331,6 +331,7 @@ else() # if this is included from LLVM's CMake
# Builtins were built separately above
CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off
-DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS}
-DLLVM_LIBRARY_DIR=${LLVM_LIBRARY_DIR}
-DCMAKE_C_COMPILER_TARGET=${target}
-DCMAKE_CXX_COMPILER_TARGET=${target}
-DCMAKE_ASM_COMPILER_TARGET=${target}
@ -376,6 +377,7 @@ else() # if this is included from LLVM's CMake
# Builtins were built separately above
CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off
-DLLVM_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS}
-DLLVM_LIBRARY_DIR=${LLVM_LIBRARY_DIR}
PASSTHROUGH_PREFIXES ${prefixes}
EXTRA_TARGETS ${extra_targets}
${test_targets}