diff --git a/clang/tools/clang-shlib/CMakeLists.txt b/clang/tools/clang-shlib/CMakeLists.txt --- a/clang/tools/clang-shlib/CMakeLists.txt +++ b/clang/tools/clang-shlib/CMakeLists.txt @@ -13,7 +13,12 @@ else() list(APPEND _OBJECTS $) endif() - list(APPEND _DEPS $) + 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 $) + endif() # clang libraries are redundant since we are linking all the individual # object files into libclang-cpp.so, so filter them out from _DEPS.