diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-02-23 06:27:04 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-02-23 06:27:04 +0000 |
commit | 043cc54d6c9dedaa6e5316fe5be02f97f16d5d2b (patch) | |
tree | 911d252e31fb6d80081baecd236f30f8177e2c7a /tools | |
parent | be66089390c5692f7a9d80e8832996f2d8fdc8c0 (diff) | |
download | llvm-043cc54d6c9dedaa6e5316fe5be02f97f16d5d2b.tar.gz llvm-043cc54d6c9dedaa6e5316fe5be02f97f16d5d2b.tar.bz2 llvm-043cc54d6c9dedaa6e5316fe5be02f97f16d5d2b.tar.xz |
Simplify linking to system libraries
The LLVMSupport library implementation consolidates all dependencies on
system libraries. Move the logic gathering system libraries out of
'cmake/modules/LLVM-Config.cmake' and into 'lib/Support/CMakeLists.txt'.
Use the target_link_libraries() command there to tell CMake about the
link dependencies of the LLVMSupport implementation. CMake will
automatically propagate this to all targets that link LLVMSupport
directly or indirectly.
We still need to build knowledge of system library dependencies into
'llvm-config'. Store the list of libraries needed in a property on
LLVMSupport and teach 'tools/llvm-config/CMakeLists.txt' to retrieve it
from there.
Drop all calls to 'link_system_libs' and 'get_system_libs' from our
CMake code. Replace their implementations with a warning that explains
the calls are no longer necessary. Also drop from 'LLVMConfig.cmake'
the HAVE_* and related variables that were published there only to allow
'get_system_libs' to run outside our build process.
Contributed by Brad King.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201969 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/llvm-config/CMakeLists.txt | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt index e653b7790c..6f29a828f5 100644 --- a/tools/llvm-config/CMakeLists.txt +++ b/tools/llvm-config/CMakeLists.txt @@ -4,7 +4,7 @@ set(BUILDVARIABLES_SRCPATH ${CMAKE_CURRENT_SOURCE_DIR}/BuildVariables.inc.in) set(BUILDVARIABLES_OBJPATH ${CMAKE_CURRENT_BINARY_DIR}/BuildVariables.inc) # Compute the substitution values for various items. -get_system_libs(LLVM_SYSTEM_LIBS_LIST) +get_property(LLVM_SYSTEM_LIBS_LIST TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS) foreach(l ${LLVM_SYSTEM_LIBS_LIST}) set(SYSTEM_LIBS ${SYSTEM_LIBS} "-l${l}") endforeach() |