mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
Fix compile issues with ffmpeg on FreeBSD and Mac OS X
This commit is contained in:
parent
378f3e7e52
commit
3951a191a3
@ -743,9 +743,9 @@ if (COMPILER=="GCC"):
|
|||||||
SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
|
SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
|
||||||
SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
|
SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
|
||||||
SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
|
SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
|
||||||
SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ffmpeg_libs)
|
SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ("libavformat/avformat.h", "libavcodec/avcodec.h", "libavutil/avutil.h"))
|
||||||
SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale", "libswscale/swscale.h"), target_pkg = "FFMPEG")
|
SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale/swscale.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
|
||||||
SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample", "libswresample/swresample.h"), target_pkg = "FFMPEG")
|
SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
|
||||||
SmartPkgEnable("FFTW", "", ("rfftw", "fftw"), ("fftw.h", "rfftw.h"))
|
SmartPkgEnable("FFTW", "", ("rfftw", "fftw"), ("fftw.h", "rfftw.h"))
|
||||||
SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
|
SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
|
||||||
SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
|
SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
|
||||||
|
@ -1445,7 +1445,7 @@ def ChooseLib(libs, thirdparty=None):
|
|||||||
print(ColorText("cyan", "Couldn't find any of the libraries " + ", ".join(libs)))
|
print(ColorText("cyan", "Couldn't find any of the libraries " + ", ".join(libs)))
|
||||||
return libs[0]
|
return libs[0]
|
||||||
|
|
||||||
def SmartPkgEnable(pkg, pkgconfig = None, libs = None, incs = None, defs = None, framework = None, target_pkg = None, tool = "pkg-config"):
|
def SmartPkgEnable(pkg, pkgconfig = None, libs = None, incs = None, defs = None, framework = None, target_pkg = None, tool = "pkg-config", thirdparty_dir = None):
|
||||||
global PKG_LIST_ALL
|
global PKG_LIST_ALL
|
||||||
if (pkg in PkgListGet() and PkgSkip(pkg)):
|
if (pkg in PkgListGet() and PkgSkip(pkg)):
|
||||||
return
|
return
|
||||||
@ -1475,15 +1475,12 @@ def SmartPkgEnable(pkg, pkgconfig = None, libs = None, incs = None, defs = None,
|
|||||||
|
|
||||||
custom_loc = PkgHasCustomLocation(pkg)
|
custom_loc = PkgHasCustomLocation(pkg)
|
||||||
|
|
||||||
if pkg.lower() == "swscale" and os.path.isfile(GetThirdpartyDir() + "ffmpeg/include/libswscale/swscale.h"):
|
# Determine the location of the thirdparty directory.
|
||||||
# Let it be handled by the ffmpeg package
|
if not thirdparty_dir:
|
||||||
LibName(target_pkg, "-lswscale")
|
thirdparty_dir = pkg.lower()
|
||||||
return
|
pkg_dir = os.path.join(GetThirdpartyDir(), thirdparty_dir)
|
||||||
if pkg.lower() == "swresample" and os.path.isfile(GetThirdpartyDir() + "ffmpeg/include/libswresample/swresample.h"):
|
|
||||||
LibName(target_pkg, "-lswresample")
|
|
||||||
return
|
|
||||||
|
|
||||||
pkg_dir = os.path.join(GetThirdpartyDir(), pkg.lower())
|
# First check if the library can be found in the thirdparty directory.
|
||||||
if not custom_loc and os.path.isdir(pkg_dir):
|
if not custom_loc and os.path.isdir(pkg_dir):
|
||||||
if framework and os.path.isdir(os.path.join(pkg_dir, framework + ".framework")):
|
if framework and os.path.isdir(os.path.join(pkg_dir, framework + ".framework")):
|
||||||
FrameworkDirectory(target_pkg, pkg_dir)
|
FrameworkDirectory(target_pkg, pkg_dir)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user