[clang-shlib] Don't link with static clang libraries

Summary:
If we are building static libraries we don't need to link them into
clang-shlib, since clang-shlib already has all the individual object
files linked in.

Reviewers: smeenai

Reviewed By: smeenai

Subscribers: mgorny, cfe-commits, llvm-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D82694
This commit is contained in:
Tom Stellard 2020-07-10 08:44:28 -07:00
parent 6dda6ff0e0
commit 1d68a780b3

View File

@ -13,7 +13,12 @@ foreach (lib ${clang_libs})
else()
list(APPEND _OBJECTS $<TARGET_OBJECTS:obj.${lib}>)
endif()
list(APPEND _DEPS $<TARGET_PROPERTY:${lib},INTERFACE_LINK_LIBRARIES>)
if (BUILD_SHARED_LIBS)
# If we are building static libraries, then we don't need to add the static
# libraries as a depedency, because we are already linking against the
# individual object files.
list(APPEND _DEPS $<TARGET_PROPERTY:${lib},INTERFACE_LINK_LIBRARIES>)
endif()
# clang libraries are redundant since we are linking all the individual
# object files into libclang-cpp.so, so filter them out from _DEPS.