@@ -45,10 +45,18 @@ jobs:
4545 os : windows-latest
4646 conan_profiles : ' ["msvc-x64"]'
4747 conan_options : -o "&:target_pre_windows10=True"
48+ - platform : windows-x64-win7
49+ os : windows-latest
50+ conan_profiles : ' ["msvc-x64-win7"]'
51+ conan_options : -o "&:target_pre_windows10=True" -o "&:with_onnxruntime=False"
4852 - platform : windows-x86
4953 os : windows-latest
5054 conan_profiles : ' ["msvc-x86"]'
5155 conan_options : -o "&:target_pre_windows10=True"
56+ - platform : windows-x86-win7
57+ os : windows-latest
58+ conan_profiles : ' ["msvc-x86-win7"]'
59+ conan_options : -o "&:target_pre_windows10=True" -o "&:with_onnxruntime=False"
5260 - platform : windows-arm64
5361 os : windows-11-arm
5462 conan_profiles : ' ["msvc-arm64"]'
@@ -119,6 +127,7 @@ jobs:
119127
120128 - name : Build recipes with our patches
121129 run : |
130+ set -x
122131 cciRepo='conan-center-index'
123132 branchName='master'
124133 recipePathQt='recipes/qt'
@@ -134,20 +143,27 @@ jobs:
134143 git sparse-checkout set \
135144 recipes/minizip \
136145 recipes/flac \
146+ recipes/onnxruntime \
137147 $recipePathQt \
138148
139149 git checkout
140150
151+ # Patch conan recipe to prevent dragging libcurl as a dependency
152+ # (can't be done via VCMI's conanfile as onnxruntime is built beforehand)
153+ git apply --ignore-whitespace ../conan_patches/onnxruntime/recipe.diff
154+
141155 # versions must be synced with: conan_patches/<package>/conandata.yml
142156 # if no custom patches are required for a package, it should be removed from here
143- for p in minizip/1.3.1 flac/1.4.2 ; do
157+ for p in minizip/1.3.1 flac/1.4.2 onnxruntime/1.18.1 ; do
144158 IFS_OLD="$IFS"
145159 IFS=/
146160 read package version <<<"$p"
147161 IFS="$IFS_OLD"
148162
149163 if [[ $package == qt ]] ; then
150164 packagePath="$recipePathQt/5.x.x"
165+ elif [[ $package == onnxruntime ]] && ${{ contains(matrix.conan_options, 'with_onnxruntime=False') }} ; then
166+ continue
151167 else
152168 packagePath="recipes/$package/all"
153169 fi
@@ -219,8 +235,11 @@ jobs:
219235
220236 - name : Remove build requirements' binaries
221237 run : |
238+ set -x
222239 graphFile='graph.json'
223- packageListFile='pkglist.json'
240+ hostPackagesFile='packages-host.json'
241+ buildPackagesFile='packages-build.json'
242+ buildFilteredPackagesFile='packages-build-filtered.txt'
224243
225244 conan graph info . \
226245 $CONAN_PROFILES \
@@ -229,12 +248,30 @@ jobs:
229248 --build=never \
230249 --no-remote \
231250 > "$graphFile"
251+
232252 conan list \
233253 --graph "$graphFile" \
234254 --graph-context=build-only \
235255 --format=json \
236- > "$packageListFile"
237- conan remove --list "$packageListFile" --confirm
256+ > $buildPackagesFile
257+
258+ conan list \
259+ --graph "$graphFile" \
260+ --graph-context=host \
261+ --format=json \
262+ > $hostPackagesFile
263+
264+ # Some are both build and host requirements and must not be removed
265+ # => exclude them from the list
266+ cat $buildPackagesFile $hostPackagesFile | jq -s '
267+ .[0]["Local Cache"] as $build_packages
268+ | (.[1]["Local Cache"] | keys) as $host_package_names
269+ | $build_packages
270+ | with_entries(select(.key as $k | $host_package_names | index($k) == null)) as $packages
271+ | {"Local Cache": $packages}
272+ ' > $buildFilteredPackagesFile
273+
274+ conan remove --list "$buildFilteredPackagesFile" --confirm
238275
239276 - name : Create list of built packages
240277 run : |
0 commit comments