From 8ac2513e9b87ccca8a6ef4cf563397eeb33c19cb Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Tue, 6 Aug 2019 19:41:23 +0000 Subject: [PATCH] Add order-dependencies to object libraries Summary: If you are generating an object library that depends on table-gen generate sources, you need the object library to depend on the tablgen target. Currently llvm_add_library doesn't add dependencies for object libraries at all, which is clearly problematic. Reviewers: compnerd, hintonda, smeenai Reviewed By: smeenai Subscribers: mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65818 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368074 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/modules/AddLLVM.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index daea27bb531..a42c55e79f5 100644 --- a/cmake/modules/AddLLVM.cmake +++ b/cmake/modules/AddLLVM.cmake @@ -448,6 +448,9 @@ function(llvm_add_library name) list(APPEND objlibs ${obj_name}) set_target_properties(${obj_name} PROPERTIES FOLDER "Object Libraries") + if(ARG_DEPENDS) + add_dependencies(${obj_name} ${ARG_DEPENDS}) + endif() endif() if(ARG_SHARED AND ARG_STATIC) -- 2.40.0