Browse Source

makepanda: Link libmpdec.a et al in emscripten even with custom libdir

rdb 1 year ago
parent
commit
7a690bb071
1 changed files with 7 additions and 4 deletions
  1. 7 4
      makepanda/makepanda.py

+ 7 - 4
makepanda/makepanda.py

@@ -1018,11 +1018,14 @@ if (COMPILER=="GCC"):
             # Python may have been compiled with these requirements.
             # Is there a cleaner way to check this?
             LinkFlag("PYTHON", "-s USE_BZIP2=1 -s USE_SQLITE3=1")
-            if not PkgHasCustomLocation("PYTHON"):
+            if PkgHasCustomLocation("PYTHON"):
+                python_libdir = FindLibDirectory("PYTHON")
+            else:
                 python_libdir = GetThirdpartyDir() + "python/lib"
-                for lib in "libmpdec.a", "libexpat.a", "libHacl_Hash_SHA2.a":
-                    if os.path.isfile(python_libdir + "/" + lib):
-                        LibName("PYTHON", python_libdir + "/" + lib)
+
+            for lib in "libmpdec.a", "libexpat.a", "libHacl_Hash_SHA2.a":
+                if os.path.isfile(python_libdir + "/" + lib):
+                    LibName("PYTHON", python_libdir + "/" + lib)
 
         if GetTarget() == "linux":
             LibName("PYTHON", "-lutil")