Improve compilation time

This commit is contained in:
loki 2020-01-27 20:10:45 +01:00
parent 3b6bcc93e0
commit aa60cb7ebc
5 changed files with 31 additions and 33 deletions

3
.gitmodules vendored
View File

@ -7,3 +7,6 @@
[submodule "ViGEmClient"]
path = ViGEmClient
url = https://github.com/ViGEm/ViGEmClient
[submodule "pre-compiled"]
path = pre-compiled
url = git@github.com:loki-47-6F-64/pre-compiled.git

View File

@ -11,31 +11,29 @@ if(WIN32)
if(SUNSHINE_STANDALONE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
if(NOT DEFINED SUNSHINE_X265_BUILD_DIR)
message("Warning: Missing SUNSHINE_X265_BUILD_DIR")
if(NOT DEFINED SUNSHINE_PREPARED_BINARIES)
set(SUNSHINE_PREPARED_BINARIES "${CMAKE_CURRENT_SOURCE_DIR}/pre-compiled/windows")
endif()
list(PREPEND PLATFORM_LIBRARIES
C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/${CMAKE_CXX_COMPILER_VERSION}/libstdc++.a
C:/msys64/mingw64/x86_64-w64-mingw32/lib/libwinpthread.a
)
set(FFMPEG_INCLUDE_DIRS
${SUNSHINE_PREPARED_BINARIES}/include)
set(FFMPEG_LIBRARIES
${SUNSHINE_PREPARED_BINARIES}/lib/libavcodec.a
${SUNSHINE_PREPARED_BINARIES}/lib/libavdevice.a
${SUNSHINE_PREPARED_BINARIES}/lib/libavfilter.a
${SUNSHINE_PREPARED_BINARIES}/lib/libavformat.a
${SUNSHINE_PREPARED_BINARIES}/lib/libavutil.a
${SUNSHINE_PREPARED_BINARIES}/lib/libpostproc.a
${SUNSHINE_PREPARED_BINARIES}/lib/libswresample.a
${SUNSHINE_PREPARED_BINARIES}/lib/libswscale.a
${SUNSHINE_PREPARED_BINARIES}/lib/libx264.a
${SUNSHINE_PREPARED_BINARIES}/lib/libx265.a
z lzma bcrypt C:/msys64/mingw64/lib/libiconv.a)
endif()
list(PREPEND PLATFORM_LIBRARIES
C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/${CMAKE_CXX_COMPILER_VERSION}/libstdc++.a
C:/msys64/mingw64/x86_64-w64-mingw32/lib/libwinpthread.a
C:/msys64/mingw64/lib/libiconv.a
)
set(FFMPEG_INCLUDE_DIRS
C:/msys64/usr/local/include)
set(FFMPEG_LIBRARIES
C:/msys64/usr/local/lib/libavcodec.a
C:/msys64/usr/local/lib/libavdevice.a
C:/msys64/usr/local/lib/libavfilter.a
C:/msys64/usr/local/lib/libavformat.a
C:/msys64/usr/local/lib/libavutil.a
C:/msys64/usr/local/lib/libpostproc.a
C:/msys64/usr/local/lib/libswresample.a
C:/msys64/usr/local/lib/libswscale.a
C:/msys64/usr/local/lib/libx264.a
${SUNSHINE_X265_BUILD_DIR}/libx265.a
z lzma bcrypt)
else()
set(SUNSHINE_STANDALONE OFF)
endif()
@ -173,6 +171,7 @@ if(SUNSHINE_STANDALONE)
C:/msys64/mingw64/lib/libssl.a
C:/msys64/mingw64/lib/libcrypto.a)
endif()
list(APPEND SUNSHINE_EXTERNAL_LIBRARIES
${CMAKE_THREAD_LIBS_INIT}
stdc++fs

View File

@ -21,16 +21,10 @@ before_build:
- cd build
build_script:
- cmd: C:\msys64\usr\bin\bash -lc "git clone --single-branch --branch stable https://github.com/mirror/x264.git"
- cmd: C:\msys64\usr\bin\bash -lc "git clone --single-branch --branch Release_3.2 https://github.com/videolan/x265.git"
- cmd: C:\msys64\usr\bin\bash -lc "git clone --single-branch --branch release/4.2 https://github.com/FFmpeg/FFmpeg.git"
- cmd: C:\msys64\usr\bin\bash -lc "export PATH=/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl && mkdir -p x265/cmake-build && cd x265/cmake-build && cmake -G'Unix Makefiles' ../source && make -j2"
- cmd: C:\msys64\usr\bin\bash -lc "export PATH=/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl && cd x264 && ./configure --enable-static --disable-cli --host=mingw64 && make -j2 && make install"
- cmd: C:\msys64\usr\bin\bash -lc "export PATH=/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl && cd FFmpeg && ./configure --enable-nonfree --enable-gpl --disable-decoders --disable-encoders --disable-doc --disable-programs --disable-network --disable-indevs --disable-outdevs --enable-static --disable-shared --enable-libx264 --enable-libx265 --extra-cflags=-I../x264 --extra-ldflags=-L../x264 --target-os=mingw64 && make -j2 && make install"
- cmd: set OLDPATH=%PATH%
- cmd: set PATH=C:\msys64\mingw64\bin
- sh: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
- cmd: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DOPENSSL_ROOT_DIR=C:\OpenSSL-v111-Win64 -DSUNSHINE_STANDALONE=ON -DSUNSHINE_X265_BUILD_DIR=C:/msys64/home/appveyor/x265/cmake-build -DSUNSHINE_ROOT=. -G "MinGW Makefiles" ..
- cmd: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DOPENSSL_ROOT_DIR=C:\OpenSSL-v111-Win64 -DSUNSHINE_STANDALONE=ON -DSUNSHINE_ROOT=. -G "MinGW Makefiles" ..
- sh: make -j$(nproc)
- cmd: mingw32-make -j2
- cmd: set PATH=%OLDPATH%

1
pre-compiled Submodule

@ -0,0 +1 @@
Subproject commit 95c5077b6613169f8781515733f7ab6b5ea43fff

View File

@ -8,7 +8,8 @@ add_executable(dxgi-info dxgi.cpp)
set_target_properties(dxgi-info PROPERTIES CXX_STANDARD 17)
target_link_libraries(dxgi-info
${CMAKE_THREAD_LIBS_INIT}
dxgi)
dxgi
${PLATFORM_LIBRARIES})
target_compile_options(dxgi-info PRIVATE ${SUNSHINE_COMPILE_OPTIONS})
add_executable(audio-info audio.cpp)
@ -17,5 +18,5 @@ target_link_libraries(audio-info
${CMAKE_THREAD_LIBS_INIT}
ksuser
windowsapp
)
target_compile_options(audio-info PRIVATE ${SUNSHINE_COMPILE_OPTIONS})
${PLATFORM_LIBRARIES})
target_compile_options(audio-info PRIVATE ${SUNSHINE_COMPILE_OPTIONS})