diff --git a/gvsbuild/patches/ffmpeg/build/build.sh b/gvsbuild/patches/ffmpeg/build/build.sh index 208147b31..adf649d22 100644 --- a/gvsbuild/patches/ffmpeg/build/build.sh +++ b/gvsbuild/patches/ffmpeg/build/build.sh @@ -40,15 +40,20 @@ configure_cmd[idx++]="--disable-postproc" if [ "$build_type" = "debug" ]; then configure_cmd[idx++]="--enable-debug" # FIXME: the -Od and -Zi instructions are overriden in the compilation command - configure_cmd[idx++]="--extra-cflags=\"-Od -Zi -MDd\"" + configure_cmd[idx++]="--extra-cflags=-MDd -Od -Zi" else configure_cmd[idx++]="--extra-cflags=-MD" fi +if [ "$build_type" = "debug-optimized" ]; then + configure_cmd[idx++]="--extra-ldflags=-DEBUG:FULL" + configure_cmd[idx++]="--extra-cflags=-Zi" +fi + if [ "$enable_gpl" = "enable_gpl" ]; then configure_cmd[idx++]="--enable-libx264" configure_cmd[idx++]="--enable-gpl" - configure_cmd[idx++]="--enable-encoder=\"libx264\"" + configure_cmd[idx++]="--enable-encoder=libx264" fi export PKG_CONFIG_PATH=$gtk_dir/lib/pkgconfig:$PKG_CONFIG_PATH diff --git a/gvsbuild/projects/ffmpeg.py b/gvsbuild/projects/ffmpeg.py index 4344cdcab..53af5a698 100644 --- a/gvsbuild/projects/ffmpeg.py +++ b/gvsbuild/projects/ffmpeg.py @@ -36,6 +36,11 @@ def __init__(self): self.add_dependency("x264") def build(self): + configuration = ( + "debug-optimized" + if self.opts.release_configuration_is_actually_debug_optimized + else self.opts.configuration + ) msys_path = Project.get_tool_path("msys2") self.exec_vs( r"%s\bash build\build.sh %s %s %s %s" @@ -43,12 +48,17 @@ def build(self): msys_path, convert_to_msys(self.pkg_dir), convert_to_msys(self.builder.gtk_dir), - self.builder.opts.configuration, + configuration, "enable_gpl" if self.opts.ffmpeg_enable_gpl else "disable_gpl", ), add_path=msys_path, ) + if configuration in ["debug-optimized", "debug"]: + self.install(r".\libavcodec\avcodec-60.pdb bin") + self.install(r".\libavutil\avutil-58.pdb bin") + self.install(r".\libswscale\libswscale-7.pdb bin") + self.install(r".\COPYING.LGPLv2.1 " r".\COPYING.LGPLv3 " r"share\doc\ffmpeg") if self.opts.ffmpeg_enable_gpl: self.install(r".\COPYING.GPLv2 " r"share\doc\ffmpeg")