llvm.org GIT mirror llvm / f51fbcb
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212934 91177308-0d34-0410-b5e6-96231b3b80d8 NAKAMURA Takumi 5 years ago
1 changed file(s) with 7 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
332332 ${lib_deps}
333333 ${llvm_libs}
334334 )
335 elseif((CYGWIN OR WIN32) AND ARG_SHARED)
336 # Win32's import library may be unaware of its dependent libs.
337 target_link_libraries(${name} PRIVATE
338 ${ARG_LINK_LIBS}
339 ${lib_deps}
340 ${llvm_libs}
341 )
335342 elseif(ARG_SHARED AND BUILD_SHARED_LIBS)
336343 # FIXME: It may be PRIVATE since SO knows its dependent libs.
337344 target_link_libraries(${name} PUBLIC