-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
200 lines (178 loc) · 8.57 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
paths:
include:
- '*'
exclude:
- 'docker/'
- 'docker-compose.yml'
- '.gitignore'
- 'README.md'
resources:
containers:
- container: qt6Container-linux
endpoint: 'myDockerHub'
image: tommoebert332/qt6-build:latest-suse
- container: qt6Container-win
endpoint: 'myDockerHub'
image: tommoebert332/qt6-build:win-jxl
jobs:
- job: Linux
pool:
vmImage: 'ubuntu-20.04'
container: qt6Container-linux
steps:
- checkout: self
submodules: true
- task: CMake@1
displayName: 'CMake configure'
inputs:
cmakeArgs: ..
workingDirectory: 'build'
- task: CMake@1
displayName: 'CMake Build'
inputs:
cmakeArgs: --build .
workingDirectory: 'build'
- task: CMake@1
displayName: 'CMake Check'
inputs:
cmakeArgs: --build . --target check
workingDirectory: 'build'
- job: Windows
timeoutInMinutes: 600
cancelTimeoutInMinutes: 2
strategy:
matrix:
Win11:
toolset: 'v143'
generator: 'Visual Studio 17 2022'
poo: 'windows-2022'
pool:
vmImage: $(poo)
container: qt6Container-win
variables:
configuration: 'Release'
platform: 'x64'
VCPKG_INSTALLATION_ROOT: 'C:/vcpkg'
PKG_CONFIG_PATH: '$(VCPKG_INSTALLATION_ROOT)/installed/$(platform)-windows-static/lib/pkgconfig'
steps:
- checkout: self
submodules: true
- bash: |
set -e
# KDE's exiv2 find module does not respect private dependencies specified in the pkgconfig file of exiv2 needed for static linking
cat << EOF > /c/vcpkg/installed/x64-windows-static/share/ECM/find-modules/FindLibExiv2.cmake
find_package(PkgConfig QUIET)
pkg_check_modules(PC_EXIV2 exiv2)
find_path(LibExiv2_INCLUDE_DIRS NAMES exiv2/exif.hpp
HINTS \${PC_EXIV2_INCLUDEDIR}
)
find_library(LibExiv2_LIBRARIES NAMES exiv2 libexiv2
HINTS \${PC_EXIV2_LIBRARY_DIRS}
)
# Handle transitive dependencies
if(PC_EXIV2_FOUND)
get_target_properties_from_pkg_config("\${LibExiv2_LIBRARIES}" "PC_EXIV2" "_exiv2")
endif()
set(LibExiv2_VERSION \${PC_EXIV2_VERSION})
if(NOT LibExiv2_VERSION AND DEFINED LibExiv2_INCLUDE_DIRS)
# With exiv >= 0.27, the version #defines are in exv_conf.h instead of version.hpp
foreach(_exiv2_version_file "version.hpp" "exv_conf.h")
if(EXISTS "\${LibExiv2_INCLUDE_DIRS}/exiv2/\${_exiv2_version_file}")
file(READ "\${LibExiv2_INCLUDE_DIRS}/exiv2/\${_exiv2_version_file}" _exiv_version_file_content)
string(REGEX MATCH "#define EXIV2_MAJOR_VERSION[ ]+\\\\([0-9]+\\\\)" EXIV2_MAJOR_VERSION_MATCH \${_exiv_version_file_content})
string(REGEX MATCH "#define EXIV2_MINOR_VERSION[ ]+\\\\([0-9]+\\\\)" EXIV2_MINOR_VERSION_MATCH \${_exiv_version_file_content})
string(REGEX MATCH "#define EXIV2_PATCH_VERSION[ ]+\\\\([0-9]+\\\\)" EXIV2_PATCH_VERSION_MATCH \${_exiv_version_file_content})
if(EXIV2_MAJOR_VERSION_MATCH)
string(REGEX REPLACE ".*_MAJOR_VERSION[ ]+\\\\((.*)\\\\)" "\\\\1" EXIV2_MAJOR_VERSION \${EXIV2_MAJOR_VERSION_MATCH})
string(REGEX REPLACE ".*_MINOR_VERSION[ ]+\\\\((.*)\\\\)" "\\\\1" EXIV2_MINOR_VERSION \${EXIV2_MINOR_VERSION_MATCH})
string(REGEX REPLACE ".*_PATCH_VERSION[ ]+\\\\((.*)\\\\)" "\\\\1" EXIV2_PATCH_VERSION \${EXIV2_PATCH_VERSION_MATCH})
endif()
endif()
endforeach()
set(LibExiv2_VERSION "\${EXIV2_MAJOR_VERSION}.\${EXIV2_MINOR_VERSION}.\${EXIV2_PATCH_VERSION}")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibExiv2
FOUND_VAR LibExiv2_FOUND
REQUIRED_VARS LibExiv2_LIBRARIES LibExiv2_INCLUDE_DIRS
VERSION_VAR LibExiv2_VERSION
)
mark_as_advanced(LibExiv2_INCLUDE_DIRS LibExiv2_LIBRARIES)
if(LibExiv2_FOUND AND NOT TARGET LibExiv2::LibExiv2)
add_library(LibExiv2::LibExiv2 UNKNOWN IMPORTED)
set_target_properties(LibExiv2::LibExiv2 PROPERTIES
IMPORTED_LOCATION "\${LibExiv2_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "\${LibExiv2_INCLUDE_DIRS}"
INTERFACE_COMPILE_OPTIONS "\${_exiv2_compile_options}"
INTERFACE_LINK_LIBRARIES "\${_exiv2_link_libraries}"
INTERFACE_LINK_DIRECTORIES "\${_exiv2_link_directories}")
endif()
include(FeatureSummary)
set_package_properties(LibExiv2 PROPERTIES
URL "https://www.exiv2.org"
DESCRIPTION "Image metadata support"
)
EOF
# libjxl's pkgconfig files do not work on windows, because they renamed the static libs
# https://github.com/libjxl/libjxl/pull/2754
cat << EOF > /c/vcpkg/installed/x64-windows-static/lib/pkgconfig/libjxl.pc
prefix=\${pcfiledir}/../..
exec_prefix=\${prefix}
libdir=\${exec_prefix}/lib
includedir=\${prefix}/include
Name: libjxl
Description: Loads and saves JPEG XL files
Version: 0.8.2
Libs: "-L\${libdir}" -ljxl-static
Libs.private: -ljxl_dec-static
Requires.private: libhwy libbrotlicommon libbrotlienc libbrotlidec lcms2
Cflags: "-I\${includedir}" -DJXL_STATIC_DEFINE
EOF
cat << EOF > /c/vcpkg/installed/x64-windows-static/lib/pkgconfig/libjxl_threads.pc
prefix=\${pcfiledir}/../..
exec_prefix=\${prefix}
libdir=\${exec_prefix}/lib
includedir=\${prefix}/include
Name: libjxl_threads
Description: JPEG XL multi-thread runner using std::threads.
Version: 0.8.2
Libs: "-L\${libdir}" -ljxl_threads-static
Requires:
Cflags: "-I\${includedir}" -DJXL_THREADS_STATIC_DEFINE
EOF
displayName: 'Fix libjxl pkgconfig files'
- script: |
@ECHO ON
mkdir build
cd build
call "C:\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" $(platform)
set PATH=%PATH%;C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64
set LIB=%LIB%;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\um\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0\ucrt\x64
set INCLUDE=%INCLUDE%;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt
@ECHO ON
cmake -G Ninja -DCMAKE_BUILD_TYPE=$(configuration) -DCMAKE_VERBOSE_MAKEFILE=ON -DVCPKG_TARGET_TRIPLET=$(platform)-windows-static -DVCPKG_PLATFORM_TOOLSET=$(toolset) -DCMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALLATION_ROOT%/scripts/buildsystems/vcpkg.cmake -DCMAKE_MAKE_PROGRAM=C:/BuildTools/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe -DCMAKE_INSTALL_PREFIX=$VCPKG_INSTALLATION_ROOT/installed/$(platform)-windows-static -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_VERBOSE_MAKEFILE=1 ..
cmake --build . --target anpv
displayName: 'Compile static ANPV'
- script: |
call "C:\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" $(platform)
set path=%path%;C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64
cmake --build build --target check
displayName: 'Run unit tests'
enabled: false
- task: CopyFiles@2
continueOnError: true
displayName: 'Copy ANPV binaries to artifact dir'
inputs:
SourceFolder: 'build'
Contents: '*anpv*'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
condition: succeededOrFailed()
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
artifactName: ANPV-standalone-$(platform)-$(poo)