llvm-build: Add support for non-installed libraries (e.g., gtest).
[oota-llvm.git] / utils / llvm-build / llvmbuild / componentinfo.py
index c32cc1aeb0663cd7616e9b24fdb861f44bde2fa1..e684ac2b7d21ca90e4a355dca607a30855e5b9ec 100644 (file)
@@ -116,6 +116,7 @@ class LibraryComponentInfo(ComponentInfo):
         kwargs['required_libraries'] = items.get_list('required_libraries')
         kwargs['add_to_library_groups'] = items.get_list(
             'add_to_library_groups')
+        kwargs['installed'] = items.get_optional_bool('installed', True)
         return kwargs
 
     @staticmethod
@@ -124,7 +125,7 @@ class LibraryComponentInfo(ComponentInfo):
         return LibraryComponentInfo(subpath, **kwargs)
 
     def __init__(self, subpath, name, dependencies, parent, library_name,
-                 required_libraries, add_to_library_groups):
+                 required_libraries, add_to_library_groups, installed):
         ComponentInfo.__init__(self, subpath, name, dependencies, parent)
 
         # If given, the name to use for the library instead of deriving it from
@@ -139,6 +140,9 @@ class LibraryComponentInfo(ComponentInfo):
         # considered part of.
         self.add_to_library_groups = list(add_to_library_groups)
 
+        # Whether or not this library is installed.
+        self.installed = installed
+
     def get_component_references(self):
         for r in ComponentInfo.get_component_references(self):
             yield r
@@ -160,6 +164,8 @@ class LibraryComponentInfo(ComponentInfo):
         if self.add_to_library_groups:
             print >>result, 'add_to_library_groups = %s' % ' '.join(
                 self.add_to_library_groups)
+        if not self.installed:
+            print >>result, 'installed = 0'
         return result.getvalue()
 
     def get_library_name(self):
@@ -194,10 +200,10 @@ class OptionalLibraryComponentInfo(LibraryComponentInfo):
       return OptionalLibraryComponentInfo(subpath, **kwargs)
 
     def __init__(self, subpath, name, dependencies, parent, library_name,
-                 required_libraries, add_to_library_groups):
+                 required_libraries, add_to_library_groups, installed):
       LibraryComponentInfo.__init__(self, subpath, name, dependencies, parent,
                                     library_name, required_libraries,
-                                    add_to_library_groups)
+                                    add_to_library_groups, installed)
 
 class LibraryGroupComponentInfo(ComponentInfo):
     type_name = 'LibraryGroup'