diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake --- a/llvm/cmake/modules/AddLLVM.cmake +++ b/llvm/cmake/modules/AddLLVM.cmake @@ -962,6 +962,11 @@ llvm_config( ${name} ${USE_SHARED} ${LLVM_LINK_COMPONENTS} ) if( LLVM_COMMON_DEPENDS ) add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} ) + # Add dependencies also to obj_name + # CMake issue 14747 -- add_dependencies() might be ignored to obj_name's user. + foreach(objlib ${obj_name}) + add_dependencies(${objlib} ${LLVM_COMMON_DEPENDS}) + endforeach() endif( LLVM_COMMON_DEPENDS ) if(NOT ARG_IGNORE_EXTERNALIZE_DEBUGINFO)