[libc] Collect objects only from visible deps of an object library.
authorSiva Chandra Reddy <sivachandra@google.com>
Wed, 1 Apr 2020 23:05:55 +0000 (16:05 -0700)
committerSiva Chandra Reddy <sivachandra@google.com>
Thu, 9 Apr 2020 17:40:37 +0000 (10:40 -0700)
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

index d47c16d..897ec84 100644 (file)
@@ -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()