diff options
| author | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-07-14 12:26:15 +0000 |
|---|---|---|
| committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2014-07-14 12:26:15 +0000 |
| commit | 6a931f507a9927158e3d84d780ee00db76efb599 (patch) | |
| tree | 184bc04df009f66749c345c6c21582abd6c0d70c /llvm | |
| parent | 3cb24110b19b03de8ec628ea10a80320e6b70314 (diff) | |
| download | bcm5719-llvm-6a931f507a9927158e3d84d780ee00db76efb599.tar.gz bcm5719-llvm-6a931f507a9927158e3d84d780ee00db76efb599.zip | |
[CMake][Win32.DLL] Let llvm_add_library(SHARED) link dependent libraries as PRIVATE.
For example, c-index-test.exe requires just libclang.dll (its import library).
When libraries in libclang were not PRIVATE but PUBLIC, c-index-test required libraries transitive by libclang.
Note, on mingw with BUILD_SHARED_LIBS, library dependencies would become more strict.
In principle, required libraries should be "required in its source file".
This will help to detect missing dependencies.
llvm-svn: 212934
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/cmake/modules/AddLLVM.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake index 85149abf5e3..0276bf6ffe4 100644 --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -333,6 +333,13 @@ function(llvm_add_library name) ${lib_deps} ${llvm_libs} ) + elseif((CYGWIN OR WIN32) AND ARG_SHARED) + # Win32's import library may be unaware of its dependent libs. + target_link_libraries(${name} PRIVATE + ${ARG_LINK_LIBS} + ${lib_deps} + ${llvm_libs} + ) elseif(ARG_SHARED AND BUILD_SHARED_LIBS) # FIXME: It may be PRIVATE since SO knows its dependent libs. target_link_libraries(${name} PUBLIC |

