Skip to content

Commit

Permalink
No longer automatically download ffmpeg
Browse files Browse the repository at this point in the history
  • Loading branch information
EIREXE committed Jun 3, 2024
1 parent 0d2dbad commit a5d66de
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
15 changes: 5 additions & 10 deletions SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,16 @@ if env["platform"] == "linuxbsd":

env_ffmpeg = env.Clone()

FFMPEG_DUMMY = "thirdparty/ffmpeg/LICENSE.txt"

ffmpeg_download_action = ffmpeg_download.ffmpeg_download_builder(
env_ffmpeg, FFMPEG_DUMMY, "gdextension_build/ffmpeg_download.py"
)

module_obj = []

excluded = []

sources = [x for x in Glob("*.cpp") if str(x) not in excluded]

env_ffmpeg.Prepend(CPPPATH="thirdparty/ffmpeg/include")
env.Append(LIBPATH=["#modules/ffmpeg/thirdparty/ffmpeg/lib"])
ffmpeg_path = env["ffmpeg_path"]

env_ffmpeg.Prepend(CPPPATH=f"{ffmpeg_path}/include")
env.Append(LIBPATH=[f"{ffmpeg_path}/lib"])

ffmpeg_libs = ["avcodec", "avfilter", "avformat", "avutil", "swresample", "swscale"]

Expand All @@ -38,8 +34,7 @@ else:
# mingw
env.Append(LIBS=ffmpeg_libs)

ffmpeg_install_action = ffmpeg_download.ffmpeg_install(env_ffmpeg, "#bin", "thirdparty/ffmpeg")
env_ffmpeg.Depends(sources, ffmpeg_install_action)
ffmpeg_install_action = ffmpeg_download.ffmpeg_install(env_ffmpeg, "#bin", ffmpeg_path)

env_ffmpeg.GLSL_HEADER("yuv_to_rgb.glsl")
env_ffmpeg.Depends(Glob("*.glsl.gen.h"), ["#glsl_builders.py"])
Expand Down
11 changes: 10 additions & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@ def can_build(env, platform):


def configure(env):
pass
if not "ffmpeg_path" in env or not env["ffmpeg_path"]:
raise RuntimeError("ffmpeg path not found")


def get_opts(platform):
from SCons.Variables import BoolVariable

return [
("ffmpeg_path", "FFmpeg path", ""),
]


def get_doc_path():
Expand Down

0 comments on commit a5d66de

Please sign in to comment.