Setup qt win64 pipeline to auto download libav from external site and link into program. Make linking libav optional in cmake for qt win64 build.

This commit is contained in:
mjbudd77 2021-09-16 21:20:59 -04:00
parent 954e7d847c
commit 3262e182e8
2 changed files with 19 additions and 8 deletions

View File

@ -22,18 +22,24 @@ cd build
mkdir bin
curl -s -LO http://www.libsdl.org/release/SDL2-devel-2.0.14-VC.zip
curl -s -LO https://github.com/GyanD/codexffmpeg/releases/download/4.4/ffmpeg-4.4-full_build-shared.zip
REM rmdir /q /s SDL2
powershell -command "Expand-Archive" SDL2-devel-2.0.14-VC.zip .
powershell -command "Expand-Archive" ffmpeg-4.4-full_build-shared.zip
rename SDL2-2.0.14 SDL2
move ffmpeg-4.4-full_build-shared\ffmpeg-4.4-full_build-shared ffmpeg
rmdir ffmpeg-4.4-full_build-shared
del ffmpeg-4.4-full_build-shared.zip
set SDL_INSTALL_PREFIX=%CD%
set FFMPEG_INSTALL_PREFIX=%CD%
REM cmake -h
REM cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DSDL_INSTALL_PREFIX=%SDL_INSTALL_PREFIX% ..
cmake -DQT6=0 -DSDL_INSTALL_PREFIX=%SDL_INSTALL_PREFIX% ..
cmake -DQT6=0 -DSDL_INSTALL_PREFIX=%SDL_INSTALL_PREFIX% -DUSE_LIBAV=1 -DFFMPEG_INSTALL_PREFIX=%FFMPEG_INSTALL_PREFIX% ..
REM nmake
msbuild /m fceux.sln /p:Configuration=Release
@ -41,6 +47,7 @@ msbuild /m fceux.sln /p:Configuration=Release
copy src\Release\fceux.exe bin\qfceux.exe
copy %SDL_INSTALL_PREFIX%\SDL2\lib\x64\SDL2.dll bin\.
copy %FFMPEG_INSTALL_PREFIX%\ffmpeg\bin\*.dll bin\.
windeployqt --no-compiler-runtime bin\qfceux.exe

View File

@ -36,13 +36,17 @@ if(WIN32)
set( SDL2_LDFLAGS ${SDL_INSTALL_PREFIX}/SDL2/lib/x64/SDL2.lib )
set( SYS_LIBS wsock32 ws2_32 vfw32 Htmlhelp )
set(APP_ICON_RESOURCES_WINDOWS ${CMAKE_SOURCE_DIR}/icons/fceux.rc )
add_definitions( -D_USE_LIBAV ${LIBAV_CFLAGS} )
include_directories( ${FFMPEG_INSTALL_PREFIX}/FFmpeg )
set( LIBAV_LDFLAGS ${FFMPEG_INSTALL_PREFIX}/FFmpeg/libavcodec/avcodec.lib
${FFMPEG_INSTALL_PREFIX}/FFmpeg/libavformat/avformat.lib
${FFMPEG_INSTALL_PREFIX}/FFmpeg/libavutil/avutil.lib
${FFMPEG_INSTALL_PREFIX}/FFmpeg/libswscale/swscale.lib
${FFMPEG_INSTALL_PREFIX}/FFmpeg/libswresample/swresample.lib )
if ( ${USE_LIBAV} )
add_definitions( -D_USE_LIBAV ${LIBAV_CFLAGS} )
include_directories( ${FFMPEG_INSTALL_PREFIX}/ffmpeg/include )
set( LIBAV_LDFLAGS ${FFMPEG_INSTALL_PREFIX}/ffmpeg/lib/avcodec.lib
${FFMPEG_INSTALL_PREFIX}/ffmpeg/lib/avformat.lib
${FFMPEG_INSTALL_PREFIX}/ffmpeg/lib/avutil.lib
${FFMPEG_INSTALL_PREFIX}/ffmpeg/lib/swscale.lib
${FFMPEG_INSTALL_PREFIX}/ffmpeg/lib/swresample.lib )
endif()
else(WIN32)
# Non Windows System
# UNIX (Linux or Mac OSX)