Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
EIREXE committed Jun 7, 2024
1 parent a5d66de commit d521fb0
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 17 deletions.
7 changes: 5 additions & 2 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ inputs:
tests:
description: Unit tests.
default: false
ffmpeg-path:
description: Path to ffmpeg
platform:
description: Target platform.
required: false
Expand All @@ -29,8 +31,9 @@ runs:
SCONSFLAGS: ${{ inputs.sconsflags }}
SCONS_CACHE: ${{ inputs.scons-cache }}
SCONS_CACHE_LIMIT: ${{ inputs.scons-cache-limit }}
FFMPEG_PATH: ${{ inputs.ffmpeg-path }}
run: |
cd gdextension_build
echo "Building with flags:" platform=${{ inputs.platform }} target=${{ inputs.target }} ${{ env.SCONSFLAGS }}
scons platform=${{ inputs.platform }} target=${{ inputs.target }} ${{ env.SCONSFLAGS }}
echo "Building with flags:" platform=${{ inputs.platform }} target=${{ inputs.target }} ffmpeg_path=${{ env.FFMPEG_PATH }} ${{ env.SCONSFLAGS }}
scons platform=${{ inputs.platform }} target=${{ inputs.target }} ffmpeg_path=${{ env.FFMPEG_PATH }} ${{ env.SCONSFLAGS }}
ls -l build/addons/ffmpeg/
6 changes: 6 additions & 0 deletions .github/workflows/linux_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,19 @@ jobs:
with:
submodules: recursive

- name: Download ffmpeg
run: |
wget https://github.com/EIRTeam/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-lgpl-godot.tar.xz
tar xvf ffmpeg-master-latest-linux64-lgpl-godot.tar.xz
- name: Setup python and scons
uses: ./.github/actions/deps

- name: Compilation
uses: ./.github/actions/build
with:
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
ffmpeg-path: "../ffmpeg-master-latest-linux64-lgpl-godot/"
platform: linux
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/windows_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,24 @@ jobs:
- name: Setup MSVC problem matcher
uses: ammaraskar/msvc-problem-matcher@master

- uses: suisei-cn/actions-download-file@v1
id: downloadfile
name: Download the file
with:
url: "https://github.com/EIRTeam/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-lgpl-godot.tar.xz"
target: .

- name: Extract tgz
uses: ihiroky/extract-action@v1
with:
file_path: ffmpeg-master-latest-win64-lgpl-godot.tar.xz
extract_dir: .

- name: Compilation
uses: ./.github/actions/build
with:
sconsflags: ${{ env.SCONSFLAGS }} ${{ matrix.sconsflags }}
ffmpeg-path: "../ffmpeg-master-latest-win64-lgpl-godot/"
platform: windows
target: ${{ matrix.target }}
tests: ${{ matrix.tests }}
Expand Down
15 changes: 8 additions & 7 deletions gdextension_build/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,27 @@ else:

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

opts.Update(env)

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

if not env["verbose"]:
methods.no_verbose(sys, env)

env.Append(CPPDEFINES=["GDEXTENSION"])
env.Append(CPPPATH=["../"])
sources = Glob("../*.cpp")
sources.extend(Glob("*.cpp"))
ffmpeg_path = env["ffmpeg_path"]

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

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

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

FFMPEG_DUMMY = "../thirdparty/ffmpeg/LICENSE.txt"
ffmpeg_download_action = ffmpeg_download.ffmpeg_download_builder(env, FFMPEG_DUMMY, "ffmpeg_download.py")
ffmpeg_install_action = ffmpeg_download.ffmpeg_install(env, f"#{addon_platform_dir}", "../thirdparty/ffmpeg")
ffmpeg_install_action = ffmpeg_download.ffmpeg_install(env, f"#{addon_platform_dir}", ffmpeg_path)
env.Depends(sources, env.Install(addon_base_dir, "ffmpeg.gdextension"))
license_install_action = env.InstallAs(f"{addon_base_dir}LICENSE-ffmpeg.txt", FFMPEG_DUMMY)
env.Depends(sources, ffmpeg_install_action)
env.Depends(sources, license_install_action)

env.GLSL_HEADER("../yuv_to_rgb.glsl")
env.Depends(Glob("../*.glsl.gen.h"), ["#glsl_builders.py"])
Expand Down
6 changes: 2 additions & 4 deletions gdextension_build/command_queue_mt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,8 @@ CommandQueueMT::SyncSemaphore *CommandQueueMT::_alloc_sync_sem() {
return &sync_sems[idx];
}

CommandQueueMT::CommandQueueMT(bool p_sync) {
if (p_sync) {
sync = memnew(Semaphore);
}
CommandQueueMT::CommandQueueMT() {
sync = memnew(Semaphore);
}

CommandQueueMT::~CommandQueueMT() {
Expand Down
8 changes: 4 additions & 4 deletions gdextension_build/command_queue_mt.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/**************************************************************************/

#ifndef ET_COMMAND_QUEUE_MT_H
#define ET_COMMAND_QUEUE_MT_H
#ifndef COMMAND_QUEUE_MT_H
#define COMMAND_QUEUE_MT_H

#ifdef GDEXTENSION

Expand Down Expand Up @@ -418,7 +418,7 @@ class CommandQueueMT {
_flush();
}

CommandQueueMT(bool p_sync);
CommandQueueMT();
~CommandQueueMT();
};

Expand All @@ -440,4 +440,4 @@ class CommandQueueMT {

#endif

#endif // ET_COMMAND_QUEUE_MT_H
#endif // COMMAND_QUEUE_MT_H

0 comments on commit d521fb0

Please sign in to comment.