From 939fa1b5604cba7ed588d68f3d2f8c1bf599bbca Mon Sep 17 00:00:00 2001 From: Siva Chandra Reddy Date: Wed, 1 Apr 2020 16:05:55 -0700 Subject: [PATCH] [libc] Collect objects only from visible deps of an object library. A typo in an earlier change allowed this check to be missed. Reviewers: abrachet Differential Revision: https://reviews.llvm.org/D77256 --- libc/cmake/modules/LLVMLibCRules.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libc/cmake/modules/LLVMLibCRules.cmake b/libc/cmake/modules/LLVMLibCRules.cmake index d47c16d..897ec84 100644 --- a/libc/cmake/modules/LLVMLibCRules.cmake +++ b/libc/cmake/modules/LLVMLibCRules.cmake @@ -142,7 +142,12 @@ function(add_object_library target_name) ${target_name} ${ADD_OBJECT_DEPENDS} ) - foreach(obj_target IN LISTS ADD_ENTRYPOINT_OBJ_SPECIAL_OBJECTS) + foreach(obj_target IN LISTS ADD_OBJECT_DEPENDS) + if(NOT TARGET ${obj_target}) + # Not all targets will be visible. So, we will ignore those which aren't + # visible yet. + continue() + endif() get_target_property(obj_type ${obj_target} "TARGET_TYPE") if((NOT obj_type) OR (NOT (${obj_type} STREQUAL ${OBJECT_LIBRARY_TARGET_TYPE}))) continue() -- 2.7.4