mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-03-02 07:21:58 +00:00
Update vcpkg based Windows CI Pipeline (#892)
This commit is contained in:
parent
a28a5e6d20
commit
bf884758cb
1 changed files with 84 additions and 38 deletions
|
@ -13,10 +13,17 @@ trigger:
|
||||||
- '.cirrus.yml'
|
- '.cirrus.yml'
|
||||||
- 'README.md'
|
- 'README.md'
|
||||||
|
|
||||||
|
parameters:
|
||||||
|
- name: UseCache
|
||||||
|
displayName: Use Dependency Cache
|
||||||
|
type: boolean
|
||||||
|
default: true
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
toolset: 'v142'
|
toolset: 'v142'
|
||||||
generator: 'Visual Studio 16 2019'
|
generator: 'Visual Studio 16 2019'
|
||||||
VCPKG_DIR: 'C:\vcpkg'
|
configuration: 'RelWithDebInfo'
|
||||||
|
VCPKG_REVISION: 'e6dcc079c81161786eb7b052209a2047e79f2c6c'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
- job: vcpkg
|
- job: vcpkg
|
||||||
|
@ -25,70 +32,109 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
ARM:
|
ARM:
|
||||||
platform: 'ARM'
|
platform: 'arm'
|
||||||
cmake_platform: 'ARM'
|
cmake_platform: 'ARM'
|
||||||
configuration: 'Release'
|
ARM64:
|
||||||
|
platform: 'arm64'
|
||||||
|
cmake_platform: 'ARM64'
|
||||||
x86:
|
x86:
|
||||||
platform: 'x86'
|
platform: 'x86'
|
||||||
cmake_platform: 'Win32'
|
cmake_platform: 'Win32'
|
||||||
configuration: 'Release'
|
|
||||||
x64:
|
x64:
|
||||||
platform: 'x64'
|
platform: 'x64'
|
||||||
cmake_platform: 'x64'
|
cmake_platform: 'x64'
|
||||||
configuration: 'Release'
|
|
||||||
pool:
|
pool:
|
||||||
vmImage: 'windows-2019'
|
vmImage: 'windows-2019'
|
||||||
steps:
|
steps:
|
||||||
- script: |
|
|
||||||
@ECHO ON
|
|
||||||
echo $(generator)
|
|
||||||
echo $(toolset)
|
|
||||||
REM choco upgrade ninja -y
|
|
||||||
REM ninja --version
|
|
||||||
cmake --version
|
|
||||||
REM manually update vcpkg
|
|
||||||
REM cd "$(VCPKG_DIR)" || exit -1
|
|
||||||
REM git pull || exit -1
|
|
||||||
REM .\bootstrap-vcpkg.bat || exit -1
|
|
||||||
REM cd $(Build.SourcesDirectory)
|
|
||||||
where vcpkg.exe
|
|
||||||
vcpkg install --only-downloads glib:$(platform)-windows
|
|
||||||
displayName: 'Prerequisites'
|
|
||||||
- task: Cache@2
|
- task: Cache@2
|
||||||
displayName: "Cache vcpkg's packages"
|
displayName: "Cache vcpkg's packages"
|
||||||
|
condition: and(not(in(variables['Build.Reason'], 'Schedule')), ${{ parameters.useCache }})
|
||||||
inputs:
|
inputs:
|
||||||
key: $(VCPKG_DIR)\downloads\glib* | "$(platform)"
|
key: $(VCPKG_REVISION) | "$(platform)"
|
||||||
path: "$(VCPKG_DIR)"
|
path: '$(VCPKG_INSTALLATION_ROOT)\installed'
|
||||||
cacheHitVar: CACHE_RESTORED
|
cacheHitVar: CACHE_RESTORED
|
||||||
- script: |
|
- bash: |
|
||||||
@ECHO ON
|
set -ex
|
||||||
vcpkg install glib:$(platform)-windows
|
echo $(generator)
|
||||||
displayName: 'vcpkg build glib'
|
echo $(toolset)
|
||||||
condition: ne(variables.CACHE_RESTORED, 'true')
|
# choco upgrade ninja -y
|
||||||
- script: |
|
# ninja --version
|
||||||
@ECHO ON
|
cmake --version
|
||||||
|
rm -rf C:/Strawberry/perl/bin/pkg-config*
|
||||||
|
choco install --svc --sdc -i pkgconfiglite &
|
||||||
|
chocoTask=$!
|
||||||
|
# manually update vcpkg
|
||||||
|
cd $VCPKG_INSTALLATION_ROOT
|
||||||
|
# git checkout master
|
||||||
|
git fetch origin
|
||||||
|
git checkout $(VCPKG_REVISION)
|
||||||
|
sed -i 's/arm64/arm/g' ports/glib/portfile.cmake
|
||||||
|
./bootstrap-vcpkg.sh
|
||||||
|
wait $chocoTask
|
||||||
|
which pkg-config
|
||||||
|
displayName: 'Update vcpkg'
|
||||||
|
- task: DownloadBuildArtifacts@0
|
||||||
|
inputs:
|
||||||
|
buildType: specific
|
||||||
|
# https://dev.azure.com/tommbrt/_apis/projects?api-version=5.0
|
||||||
|
project: 'd3638885-de4a-4ce7-afe7-f237ae461c07'
|
||||||
|
pipeline: 1
|
||||||
|
artifactName: libinstpatch-$(cmake_platform)
|
||||||
|
downloadPath: '$(Agent.TempDirectory)'
|
||||||
|
displayName: 'Get libinstpatch'
|
||||||
|
condition: and(succeeded(), and(ne(variables['platform'], 'arm'), ne(variables['platform'], 'arm64')))
|
||||||
|
- task: CopyFiles@2
|
||||||
|
inputs:
|
||||||
|
SourceFolder: '$(Agent.TempDirectory)\libinstpatch-$(cmake_platform)'
|
||||||
|
Contents: '**'
|
||||||
|
TargetFolder: '$(VCPKG_INSTALLATION_ROOT)\installed\$(platform)-windows'
|
||||||
|
displayName: 'Install libinstpatch'
|
||||||
|
condition: and(succeeded(), and(ne(variables['platform'], 'arm'), ne(variables['platform'], 'arm64')))
|
||||||
|
- bash: |
|
||||||
|
set -ex
|
||||||
|
vcpkg install glib:$(platform)-windows libsndfile:$(platform)-windows
|
||||||
|
displayName: 'vcpkg build Dependencies'
|
||||||
|
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
|
||||||
|
- bash: |
|
||||||
|
set -ex
|
||||||
|
cd $VCPKG_INSTALLATION_ROOT/installed/$(platform)-windows/
|
||||||
|
pwd
|
||||||
|
rm -rf include/FLAC* include/ffi* include/iconv* include/opus tools share
|
||||||
|
ls -Rg .
|
||||||
|
pkg-config --list-all
|
||||||
|
pkg-config --cflags libinstpatch-1.0 || true
|
||||||
|
displayName: 'Cleanup dependencies'
|
||||||
|
condition: and(succeeded(), ne(variables.CACHE_RESTORED, 'true'))
|
||||||
|
- bash: |
|
||||||
|
set -ex
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
cmake -Werror=dev -G "$(generator)" -A "$(cmake_platform)" -T "$(toolset)" -Denable-pkgconfig=0 -Denable-jack=0 -Denable-pulseaudio=0 -Denable-ladspa=0 -Denable-dbus=0 -Denable-readline=0 -Denable-sdl2=0 -Denable-libinstpatch=0 -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 .. || exit -1
|
cmake -Werror=dev -G "$(generator)" -A "$(cmake_platform)" -T "$(toolset)" -Denable-readline=0 -DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=$VCPKG_INSTALLATION_ROOT/installed/$(platform)-windows -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 ..
|
||||||
REM build libfluidsynth and fluidsynth exec
|
cmake --build . --config $(configuration) --parallel 3
|
||||||
cmake --build . --config $(configuration) --parallel 3 || exit -1
|
|
||||||
displayName: 'Compile fluidsynth'
|
displayName: 'Compile fluidsynth'
|
||||||
- script: |
|
- bash: |
|
||||||
@ECHO ON
|
set -ex
|
||||||
REM build and exec unittests, unless when cross-compiling
|
cmake --build build --config $(configuration) --target check --parallel 3
|
||||||
if not "%platform%"=="ARM" ( cmake --build build --config $(configuration) --target check --parallel 3 )
|
|
||||||
displayName: 'Execute Unittests'
|
displayName: 'Execute Unittests'
|
||||||
|
condition: and(succeeded(), and(ne(variables['platform'], 'arm'), ne(variables['platform'], 'arm64')))
|
||||||
- script: |
|
- script: |
|
||||||
@ECHO ON
|
@ECHO ON
|
||||||
cd build
|
cd build
|
||||||
cmake --build . --config $(configuration) --target install || exit -1
|
cmake --build . --config $(configuration) --target install || exit -1
|
||||||
REM del $(Build.ArtifactStagingDirectory)\bin\concrt*.dll
|
REM del bin\concrt*.dll
|
||||||
REM del $(Build.ArtifactStagingDirectory)\bin\vcruntime*.dll
|
REM del $(Build.ArtifactStagingDirectory)\bin\vcruntime*.dll
|
||||||
REM del $(Build.ArtifactStagingDirectory)\bin\msvcp*.dll
|
REM del $(Build.ArtifactStagingDirectory)\bin\msvcp*.dll
|
||||||
REM del $(Build.ArtifactStagingDirectory)\lib\instpatch*.lib
|
REM del $(Build.ArtifactStagingDirectory)\lib\instpatch*.lib
|
||||||
REM del $(Build.ArtifactStagingDirectory)\lib\pkgconfig\libinstpatch*.pc
|
REM del $(Build.ArtifactStagingDirectory)\lib\pkgconfig\libinstpatch*.pc
|
||||||
REM rd $(Build.ArtifactStagingDirectory)\include\libinstpatch-2 /s /q
|
REM rd $(Build.ArtifactStagingDirectory)\include\libinstpatch-2 /s /q
|
||||||
displayName: 'Copy Artifacts'
|
displayName: 'fluidsynth install'
|
||||||
|
- task: CopyFiles@2
|
||||||
|
inputs:
|
||||||
|
SourceFolder: '$(VCPKG_INSTALLATION_ROOT)/installed/$(platform)-windows/'
|
||||||
|
Contents: '**'
|
||||||
|
TargetFolder: '$(Build.ArtifactStagingDirectory)'
|
||||||
|
CleanTargetFolder: true
|
||||||
|
displayName: 'Copy Binaries to Artifact Dir'
|
||||||
- task: PublishBuildArtifacts@1
|
- task: PublishBuildArtifacts@1
|
||||||
inputs:
|
inputs:
|
||||||
pathtoPublish: $(Build.ArtifactStagingDirectory)
|
pathtoPublish: $(Build.ArtifactStagingDirectory)
|
||||||
|
|
Loading…
Reference in a new issue