Skip to content

Commit d521fb0

Browse files
committed
Fix CI
1 parent a5d66de commit d521fb0

File tree

6 files changed

+39
-17
lines changed

6 files changed

+39
-17
lines changed

.github/actions/build/action.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ inputs:
77
tests:
88
description: Unit tests.
99
default: false
10+
ffmpeg-path:
11+
description: Path to ffmpeg
1012
platform:
1113
description: Target platform.
1214
required: false
@@ -29,8 +31,9 @@ runs:
2931
SCONSFLAGS: ${{ inputs.sconsflags }}
3032
SCONS_CACHE: ${{ inputs.scons-cache }}
3133
SCONS_CACHE_LIMIT: ${{ inputs.scons-cache-limit }}
34+
FFMPEG_PATH: ${{ inputs.ffmpeg-path }}
3235
run: |
3336
cd gdextension_build
34-
echo "Building with flags:" platform=${{ inputs.platform }} target=${{ inputs.target }} ${{ env.SCONSFLAGS }}
35-
scons platform=${{ inputs.platform }} target=${{ inputs.target }} ${{ env.SCONSFLAGS }}
37+
echo "Building with flags:" platform=${{ inputs.platform }} target=${{ inputs.target }} ffmpeg_path=${{ env.FFMPEG_PATH }} ${{ env.SCONSFLAGS }}
38+
scons platform=${{ inputs.platform }} target=${{ inputs.target }} ffmpeg_path=${{ env.FFMPEG_PATH }} ${{ env.SCONSFLAGS }}
3639
ls -l build/addons/ffmpeg/

.github/workflows/linux_builds.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,19 @@ jobs:
3535
with:
3636
submodules: recursive
3737

38+
- name: Download ffmpeg
39+
run: |
40+
wget https://github.com/EIRTeam/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-lgpl-godot.tar.xz
41+
tar xvf ffmpeg-master-latest-linux64-lgpl-godot.tar.xz
42+
3843
- name: Setup python and scons
3944
uses: ./.github/actions/deps
4045

4146
- name: Compilation
4247
uses: ./.github/actions/build
4348
with:
4449
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
50+
ffmpeg-path: "../ffmpeg-master-latest-linux64-lgpl-godot/"
4551
platform: linux
4652
target: ${{ matrix.target }}
4753
tests: ${{ matrix.tests }}

.github/workflows/windows_builds.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,24 @@ jobs:
4242
- name: Setup MSVC problem matcher
4343
uses: ammaraskar/msvc-problem-matcher@master
4444

45+
- uses: suisei-cn/actions-download-file@v1
46+
id: downloadfile
47+
name: Download the file
48+
with:
49+
url: "https://github.com/EIRTeam/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-lgpl-godot.tar.xz"
50+
target: .
51+
52+
- name: Extract tgz
53+
uses: ihiroky/extract-action@v1
54+
with:
55+
file_path: ffmpeg-master-latest-win64-lgpl-godot.tar.xz
56+
extract_dir: .
57+
4558
- name: Compilation
4659
uses: ./.github/actions/build
4760
with:
4861
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
62+
ffmpeg-path: "../ffmpeg-master-latest-win64-lgpl-godot/"
4963
platform: windows
5064
target: ${{ matrix.target }}
5165
tests: ${{ matrix.tests }}

gdextension_build/SConstruct

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,27 @@ else:
5555

5656
opts = Variables([], ARGUMENTS)
5757
opts.Add(BoolVariable("verbose", "Enable verbose output for the compilation", False))
58+
opts.Add(("ffmpeg_path", "Path to FFmpeg", ""))
5859

5960
opts.Update(env)
6061

62+
if not "ffmpeg_path" in env or not env["ffmpeg_path"]:
63+
raise RuntimeError("ffmpeg path not found")
64+
6165
if not env["verbose"]:
6266
methods.no_verbose(sys, env)
6367

6468
env.Append(CPPDEFINES=["GDEXTENSION"])
6569
env.Append(CPPPATH=["../"])
6670
sources = Glob("../*.cpp")
6771
sources.extend(Glob("*.cpp"))
72+
ffmpeg_path = env["ffmpeg_path"]
6873

69-
env.Prepend(CPPPATH="../thirdparty/ffmpeg/include")
70-
env.Append(LIBPATH="../thirdparty/ffmpeg/lib")
7174
ffmpeg_libs = ["avcodec", "avfilter", "avformat", "avutil", "swresample", "swscale"]
7275

7376
env.Append(LIBS=ffmpeg_libs)
77+
env.Prepend(CPPPATH=f"{ffmpeg_path}/include")
78+
env.Append(LIBPATH=[f"{ffmpeg_path}/lib"])
7479

7580
if env["platform"] == "windows" and sys.platform == "win32" and not env.get("is_msvc", False):
7681
# Workaround for https://github.com/godotengine/godot-cpp/issues/1064
@@ -100,13 +105,9 @@ else:
100105
source=sources,
101106
)
102107

103-
FFMPEG_DUMMY = "../thirdparty/ffmpeg/LICENSE.txt"
104-
ffmpeg_download_action = ffmpeg_download.ffmpeg_download_builder(env, FFMPEG_DUMMY, "ffmpeg_download.py")
105-
ffmpeg_install_action = ffmpeg_download.ffmpeg_install(env, f"#{addon_platform_dir}", "../thirdparty/ffmpeg")
108+
ffmpeg_install_action = ffmpeg_download.ffmpeg_install(env, f"#{addon_platform_dir}", ffmpeg_path)
106109
env.Depends(sources, env.Install(addon_base_dir, "ffmpeg.gdextension"))
107-
license_install_action = env.InstallAs(f"{addon_base_dir}LICENSE-ffmpeg.txt", FFMPEG_DUMMY)
108110
env.Depends(sources, ffmpeg_install_action)
109-
env.Depends(sources, license_install_action)
110111

111112
env.GLSL_HEADER("../yuv_to_rgb.glsl")
112113
env.Depends(Glob("../*.glsl.gen.h"), ["#glsl_builders.py"])

gdextension_build/command_queue_mt.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,8 @@ CommandQueueMT::SyncSemaphore *CommandQueueMT::_alloc_sync_sem() {
7171
return &sync_sems[idx];
7272
}
7373

74-
CommandQueueMT::CommandQueueMT(bool p_sync) {
75-
if (p_sync) {
76-
sync = memnew(Semaphore);
77-
}
74+
CommandQueueMT::CommandQueueMT() {
75+
sync = memnew(Semaphore);
7876
}
7977

8078
CommandQueueMT::~CommandQueueMT() {

gdextension_build/command_queue_mt.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
2929
/**************************************************************************/
3030

31-
#ifndef ET_COMMAND_QUEUE_MT_H
32-
#define ET_COMMAND_QUEUE_MT_H
31+
#ifndef COMMAND_QUEUE_MT_H
32+
#define COMMAND_QUEUE_MT_H
3333

3434
#ifdef GDEXTENSION
3535

@@ -418,7 +418,7 @@ class CommandQueueMT {
418418
_flush();
419419
}
420420

421-
CommandQueueMT(bool p_sync);
421+
CommandQueueMT();
422422
~CommandQueueMT();
423423
};
424424

@@ -440,4 +440,4 @@ class CommandQueueMT {
440440

441441
#endif
442442

443-
#endif // ET_COMMAND_QUEUE_MT_H
443+
#endif // COMMAND_QUEUE_MT_H

0 commit comments

Comments
 (0)