Skip to content

Commit a5d66de

Browse files
committed
No longer automatically download ffmpeg
1 parent 0d2dbad commit a5d66de

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

SCsub

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,16 @@ if env["platform"] == "linuxbsd":
1414

1515
env_ffmpeg = env.Clone()
1616

17-
FFMPEG_DUMMY = "thirdparty/ffmpeg/LICENSE.txt"
18-
19-
ffmpeg_download_action = ffmpeg_download.ffmpeg_download_builder(
20-
env_ffmpeg, FFMPEG_DUMMY, "gdextension_build/ffmpeg_download.py"
21-
)
22-
2317
module_obj = []
2418

2519
excluded = []
2620

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

29-
env_ffmpeg.Prepend(CPPPATH="thirdparty/ffmpeg/include")
30-
env.Append(LIBPATH=["#modules/ffmpeg/thirdparty/ffmpeg/lib"])
23+
ffmpeg_path = env["ffmpeg_path"]
24+
25+
env_ffmpeg.Prepend(CPPPATH=f"{ffmpeg_path}/include")
26+
env.Append(LIBPATH=[f"{ffmpeg_path}/lib"])
3127

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

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

41-
ffmpeg_install_action = ffmpeg_download.ffmpeg_install(env_ffmpeg, "#bin", "thirdparty/ffmpeg")
42-
env_ffmpeg.Depends(sources, ffmpeg_install_action)
37+
ffmpeg_install_action = ffmpeg_download.ffmpeg_install(env_ffmpeg, "#bin", ffmpeg_path)
4338

4439
env_ffmpeg.GLSL_HEADER("yuv_to_rgb.glsl")
4540
env_ffmpeg.Depends(Glob("*.glsl.gen.h"), ["#glsl_builders.py"])

config.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@ def can_build(env, platform):
66

77

88
def configure(env):
9-
pass
9+
if not "ffmpeg_path" in env or not env["ffmpeg_path"]:
10+
raise RuntimeError("ffmpeg path not found")
11+
12+
13+
def get_opts(platform):
14+
from SCons.Variables import BoolVariable
15+
16+
return [
17+
("ffmpeg_path", "FFmpeg path", ""),
18+
]
1019

1120

1221
def get_doc_path():

0 commit comments

Comments
 (0)