From 6f17a9e36a9db7a38a6702051c3972b2f2b1f010 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 22 Jan 2020 09:16:02 +0100 Subject: [PATCH] makepanda: disable plug-ins in Config.prc that weren't compiled This also disables the plug-ins if we are building them statically. --- makepanda/makepanda.py | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index a3a7ed35a3..58949531d3 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -3132,14 +3132,28 @@ else: # otherwise, disable it. confautoprc = confautoprc.replace('#st#', '#') -if PkgSkip("ASSIMP"): +confautoprc = confautoprc.replace('\r\n', '\n') + +if PkgSkip("ASSIMP") or GetLinkAllStatic(): confautoprc = confautoprc.replace("load-file-type p3assimp", "#load-file-type p3assimp") +if PkgSkip("EGG") or GetLinkAllStatic(): + confautoprc = confautoprc.replace("load-file-type egg pandaegg", "#load-file-type egg pandaegg") + +if PkgSkip("PANDATOOL") or PkgSkip("EGG") or GetLinkAllStatic(): + confautoprc = confautoprc.replace("load-file-type p3ptloader", "#load-file-type p3ptloader") + +if PkgSkip("FFMPEG") or GetLinkAllStatic(): + confautoprc = confautoprc.replace("load-audio-type * p3ffmpeg", "#load-audio-type * p3ffmpeg") + confautoprc = confautoprc.replace("load-video-type * p3ffmpeg", "#load-video-type * p3ffmpeg") + if (os.path.isfile("makepanda/myconfig.in")): configprc = ReadFile("makepanda/myconfig.in") else: configprc = ReadFile("makepanda/config.in") +configprc = configprc.replace('\r\n', '\n') + if (GetTarget() == 'windows'): configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$USER_APPDATA/Panda3D-%s" % MAJOR_VERSION) else: @@ -3149,7 +3163,23 @@ if (GetTarget() == 'darwin'): configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$HOME/Library/Caches/Panda3D-%s" % MAJOR_VERSION) # OpenAL is not yet working well on OSX for us, so let's do this for now. - configprc = configprc.replace("p3openal_audio", "p3fmod_audio") + if not PkgSkip("FMODEX"): + configprc = configprc.replace("p3openal_audio", "p3fmod_audio") + +if PkgSkip("GL") or GetLinkAllStatic(): + configprc = configprc.replace("\nload-display pandagl", "\n#load-display pandagl") + +if PkgSkip("GLES") or GetLinkAllStatic(): + configprc = configprc.replace("\n#load-display pandagles", "") + +if PkgSkip("DX9") or GetLinkAllStatic(): + configprc = configprc.replace("\n#load-display pandadx9", "") + +if PkgSkip("TINYDISPLAY") or GetLinkAllStatic(): + configprc = configprc.replace("\n#load-display p3tinydisplay", "") + +if PkgSkip("OPENAL") or GetLinkAllStatic(): + configprc = configprc.replace("audio-library-name p3openal_audio", "#audio-library-name p3openal_audio") if GetTarget() == 'windows': # Convert to Windows newlines.