makepanda: Support building with mimalloc on non-Windows

For experimentation only - it's disabled by default unless you also specify --override USE_MEMORY_MIMALLOC=1 (I did not see a discernable benefit over glibc, but more experimentation is warranted, especially with older glibc versions)
This commit is contained in:
rdb 2022-02-05 22:19:52 +01:00
parent 5bb616dca7
commit 4e925a839a

View File

@ -780,8 +780,6 @@ if (COMPILER == "MSVC"):
LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletSoftBody" + suffix) LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletSoftBody" + suffix)
if (COMPILER=="GCC"): if (COMPILER=="GCC"):
PkgDisable("MIMALLOC") # no discernable benefit over glibc
if GetTarget() != "darwin": if GetTarget() != "darwin":
PkgDisable("COCOA") PkgDisable("COCOA")
@ -855,6 +853,7 @@ if (COMPILER=="GCC"):
SmartPkgEnable("OPUS", "opusfile", ("opusfile", "opus", "ogg"), ("ogg/ogg.h", "opus/opusfile.h", "opus")) SmartPkgEnable("OPUS", "opusfile", ("opusfile", "opus", "ogg"), ("ogg/ogg.h", "opus/opusfile.h", "opus"))
SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h") SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config") SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
SmartPkgEnable("MIMALLOC", "", ("mimalloc"), "mimalloc.h")
# Copy freetype libraries to be specified after harfbuzz libraries as well, # Copy freetype libraries to be specified after harfbuzz libraries as well,
# because there's a circular dependency between the two libraries. # because there's a circular dependency between the two libraries.
@ -924,6 +923,9 @@ if (COMPILER=="GCC"):
LibName("ARTOOLKIT", "-Wl,--exclude-libs,libAR.a") LibName("ARTOOLKIT", "-Wl,--exclude-libs,libAR.a")
LibName("ARTOOLKIT", "-Wl,--exclude-libs,libARMulti.a") LibName("ARTOOLKIT", "-Wl,--exclude-libs,libARMulti.a")
if not PkgSkip("MIMALLOC"):
LibName("MIMALLOC", "-Wl,--exclude-libs,libmimalloc.a")
if PkgSkip("FFMPEG") or GetTarget() == "darwin": if PkgSkip("FFMPEG") or GetTarget() == "darwin":
cv_lib = ChooseLib(("opencv_core", "cv"), "OPENCV") cv_lib = ChooseLib(("opencv_core", "cv"), "OPENCV")
if cv_lib == "opencv_core": if cv_lib == "opencv_core":