llvm-build: Don't emit library information for disabled targets.
[oota-llvm.git] / utils / llvm-build / llvmbuild / main.py
index 2be9cd6b4465e6b703faf5987cb5db7b1b8a0932..48b59bdac38cf84a8f7de7822f9365dd744c8c1a 100644 (file)
@@ -319,11 +319,16 @@ subdirectories = %s
         # dependencies for added library groups.
         entries = {}
         for c in self.ordered_component_infos:
-            # Skip optional components which are not enabled
+            # Skip optional components which are not enabled.
             if c.type_name == 'OptionalLibrary' \
                 and c.name not in enabled_optional_components:
                 continue
 
+            # Skip target groups which are not enabled.
+            tg = c.get_parent_target_group()
+            if tg and not tg.enabled:
+                continue
+
             # Only certain components are in the table.
             if c.type_name not in ('Library', 'OptionalLibrary', \
                                    'LibraryGroup', 'TargetGroup'):