waf: separate out get_tgt_list()
authorAndrew Tridgell <tridge@samba.org>
Fri, 29 Oct 2010 00:52:25 +0000 (11:52 +1100)
committerAndrew Tridgell <tridge@samba.org>
Sat, 30 Oct 2010 12:49:00 +0000 (23:49 +1100)
this is a useful function for the new symbols code, so separate it out
of samba_deps.py

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

buildtools/wafsamba/samba_deps.py
buildtools/wafsamba/samba_utils.py

index bbd945210b5530b8d45c781cced7e52839d4fd6e..3bcf8fd92ef6b56807fdc609f147918809f482ef 100644 (file)
@@ -1077,21 +1077,10 @@ def load_samba_deps(bld, tgt_list):
 def check_project_rules(bld):
     '''check the project rules - ensuring the targets are sane'''
 
-    targets = LOCAL_CACHE(bld, 'TARGET_TYPE')
     loops = {}
     inc_loops = {}
 
-    # build a list of task generators we are interested in
-    tgt_list = []
-    for tgt in targets:
-        type = targets[tgt]
-        if not type in ['SUBSYSTEM', 'MODULE', 'BINARY', 'LIBRARY', 'ASN1', 'PYTHON']:
-            continue
-        t = bld.name_to_obj(tgt, bld.env)
-        if t is None:
-            Logs.error("Target %s of type %s has no task generator" % (tgt, type))
-            sys.exit(1)
-        tgt_list.append(t)
+    tgt_list = get_tgt_list(bld)
 
     add_samba_attributes(bld, tgt_list)
 
index 4139aa13f7a4ad0a75169f5f2307bf924ec2bcf3..de630fedee96e7a3cd121091af42e2ef0df01ff8 100644 (file)
@@ -569,3 +569,22 @@ def make_libname(ctx, name, nolibprefix=False, version=None, python=False):
             libname = "%s%s.%s" % (root, ext, version)
     return libname
 Build.BuildContext.make_libname = make_libname
+
+
+def get_tgt_list(bld):
+    '''return a list of build objects for samba'''
+
+    targets = LOCAL_CACHE(bld, 'TARGET_TYPE')
+
+    # build a list of task generators we are interested in
+    tgt_list = []
+    for tgt in targets:
+        type = targets[tgt]
+        if not type in ['SUBSYSTEM', 'MODULE', 'BINARY', 'LIBRARY', 'ASN1', 'PYTHON']:
+            continue
+        t = bld.name_to_obj(tgt, bld.env)
+        if t is None:
+            Logs.error("Target %s of type %s has no task generator" % (tgt, type))
+            sys.exit(1)
+        tgt_list.append(t)
+    return tgt_list