Browse Source

get frameworks from pkg-config as well

David Rose 14 years ago
parent
commit
8525e325c3
1 changed files with 13 additions and 1 deletions
  1. 13 1
      makepanda/makepandacore.py

+ 13 - 1
makepanda/makepandacore.py

@@ -1008,9 +1008,21 @@ def PkgConfigGetLibs(pkgname, tool = "pkg-config"):
     result = handle.read().strip()
     handle.close()
     libs = []
-    for l in result.split(" "):
+
+    # Walk through the result arguments carefully.  Look for -lname as
+    # well as -framework name.
+    r = result.split(' ')
+    ri = 0
+    while ri < len(r):
+        l = r[ri]
         if l.startswith("-l") or l.startswith("/"):
             libs.append(l)
+        elif l == '-framework':
+            libs.append(l)
+            ri += 1
+            libs.append(r[ri])
+        ri += 1
+
     return libs
 
 def PkgConfigGetIncDirs(pkgname, tool = "pkg-config"):