diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-02-26 06:53:16 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-02-26 06:53:16 +0000 |
commit | 07f95b3218e6590ac3476200147f8ce3ffafed93 (patch) | |
tree | 1f6aa02950572c800e050253ab428bab10d000b2 /cmake/modules/AddLLVM.cmake | |
parent | ecb903c1b57e46a2ee9e08dcd0013cfa33870b60 (diff) | |
download | llvm-07f95b3218e6590ac3476200147f8ce3ffafed93.tar.gz llvm-07f95b3218e6590ac3476200147f8ce3ffafed93.tar.bz2 llvm-07f95b3218e6590ac3476200147f8ce3ffafed93.tar.xz |
[CMake] Use target_link_libraries(INTERFACE|PRIVATE) on CMake-2.8.12 to increase opportunity for parallel build.
target_link_libraries(INTERFACE) doesn't bring inter-target dependencies in add_library,
although final targets have dependencies to whole dependent libraries.
It makes most libraries can be built in parallel.
target_link_libraries(PRIVATE) is used to shaared library.
Each dependent library is linked to the target.so, and its user will not see its grandchildren.
For example,
- libclang.so has sufficient libclang*.a(s).
- c-index-test requires just only libclang.so.
FIXME: lld is tweaked minimally. Adding INTERFACE in each library would be better thing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202241 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake/modules/AddLLVM.cmake')
-rw-r--r-- | cmake/modules/AddLLVM.cmake | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index bce3b2dd76..543ba93e55 100644 --- a/cmake/modules/AddLLVM.cmake +++ b/cmake/modules/AddLLVM.cmake @@ -289,7 +289,12 @@ function(llvm_add_library name) endif() endif() - target_link_libraries(${name} ${ARG_LINK_LIBS}) + if(ARG_STATIC) + target_link_libraries(${name} ${cmake_2_8_12_INTERFACE} ${ARG_LINK_LIBS}) + else() + # MODULE|SHARED + target_link_libraries(${name} ${cmake_2_8_12_PRIVATE} ${ARG_LINK_LIBS}) + endif() llvm_config(${name} ${ARG_LINK_COMPONENTS} ${LLVM_LINK_COMPONENTS}) @@ -330,7 +335,7 @@ macro(add_llvm_library name) # name, but using get_property(... SET) doesn't suffice to determine if a # property has been set to an empty value. get_property(lib_deps GLOBAL PROPERTY LLVMBUILD_LIB_DEPS_${name}) - target_link_libraries(${name} ${lib_deps}) + target_link_libraries(${name} ${cmake_2_8_12_INTERFACE} ${lib_deps}) endmacro(add_llvm_library name) macro(add_llvm_loadable_module name) |