build: link libavcodec statically

This commit is contained in:
rr- 2021-12-07 13:25:37 +01:00
parent 8aa2420e96
commit 2db3754765
No known key found for this signature in database
GPG key ID: CC65E6FD28CAE42A
6 changed files with 7 additions and 36 deletions

View file

@ -32,7 +32,7 @@ jobs:
- name: Package release
run: |
7z a Tomb1Main-${{ steps.get_version.outputs.VERSION }}.zip ./bin/* ./build/*.dll ./build/*.exe
7z a Tomb1Main-${{ steps.get_version.outputs.VERSION }}.zip ./bin/* ./build/*.exe
- name: Create release
id: create_release

View file

@ -30,7 +30,6 @@ lint:
test_base:
cp build/*.exe test/
cp build/*.dll test/
rsync -r bin/ test/
test: build test_base

View file

@ -64,7 +64,6 @@ RUN cd FFmpeg \
--enable-demuxer=h264 \
--enable-demuxer=image2 \
--enable-zlib \
--enable-shared \
--enable-static \
--disable-ffplay \
--disable-ffprobe \

View file

@ -6,21 +6,10 @@ if [ ! -f /app/build/build.ninja ]; then
meson --buildtype "$TARGET" /app/build/ --cross /app/docker/meson_linux_mingw32.txt --pkg-config-path=$PKG_CONFIG_PATH
fi
cp /usr/lib/gcc/i686-w64-mingw32/9.3-posix/libgcc_s_sjlj-1.dll /app/build/
cp /usr/i686-w64-mingw32/lib/libwinpthread-1.dll /app/build/
cp /ext/bin/swscale-5.dll /app/build/
cp /ext/bin/swresample-3.dll /app/build/
cp /ext/bin/avutil-56.dll /app/build/
cp /ext/bin/avfilter-7.dll /app/build/
cp /ext/bin/avcodec-58.dll /app/build/
cp /ext/bin/avdevice-58.dll /app/build/
cp /ext/bin/zlib1.dll /app/build/
cp /ext/bin/avformat-58.dll /app/build/
cd /app/build; meson compile
if [ "$TARGET" = release ]; then
for file in *.dll *.exe; do
for file in *.exe; do
upx -t "$file" || ( i686-w64-mingw32-strip "$file" && upx "$file" )
done
fi

View file

@ -36,11 +36,11 @@ dep_opengl32 = c_compiler.find_library('opengl32')
dep_dinput8 = c_compiler.find_library('dinput8')
dep_dxguid = c_compiler.find_library('dxguid')
dep_avcodec = dependency('libavcodec', static: false)
dep_avformat = dependency('libavformat', static: false)
dep_avutil = dependency('libavutil', static: false)
dep_swscale = dependency('libswscale', static: false)
dep_swresample = dependency('libswresample', static: false)
dep_avcodec = dependency('libavcodec', static: true)
dep_avformat = dependency('libavformat', static: true)
dep_avutil = dependency('libavutil', static: true)
dep_swscale = dependency('libswscale', static: true)
dep_swresample = dependency('libswresample', static: true)
dep_sdl2 = dependency('SDL2', static: true)

View file

@ -270,22 +270,6 @@ static const struct TextureFormatEntry {
{ AV_PIX_FMT_NONE, SDL_PIXELFORMAT_UNKNOWN },
};
void avcodec_free_context(AVCodecContext **pavctx)
{
AVCodecContext *avctx = *pavctx;
if (!avctx) {
return;
}
avcodec_close(avctx);
av_freep(&avctx->extradata);
av_freep(&avctx->subtitle_header);
av_freep(&avctx->intra_matrix);
av_freep(&avctx->inter_matrix);
av_freep(&avctx->rc_override);
av_freep(pavctx);
}
static int S_FMV_PacketQueuePutPrivate(PacketQueue *q, AVPacket *pkt)
{
MyAVPacketList pkt1;