More robust include searching.
authorRobert Bradshaw <robertwb@math.washington.edu>
Sun, 5 Dec 2010 12:18:47 +0000 (04:18 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Sun, 5 Dec 2010 12:18:47 +0000 (04:18 -0800)
Cython/Build/Dependencies.py

index 007ec191393f1017c104ad6b06c77faedaee43a8..065b32055d24a4f0b666605a5fac7ceccced113e 100644 (file)
@@ -265,9 +265,15 @@ class DependencyTree(object):
         cimports = set(cimports)
         externs = set(externs)
         for include in includes:
-            a, b = self.cimports_and_externs(os.path.join(os.path.dirname(filename), include))
-            cimports.update(a)
-            externs.update(b)
+            include_path = os.path.join(os.path.dirname(filename), include)
+            if not os.path.exists(include_path):
+                include_path = self.context.find_include_file(include)
+            if include_path:
+                a, b = self.cimports_and_externs(include_path)
+                cimports.update(a)
+                externs.update(b)
+            else:
+                print "Unable to locate '%s' referenced from '%s'" % (filename, include)
         return tuple(cimports), tuple(externs)
     cimports_and_externs = cached_method(cimports_and_externs)