Commit ff044ef
ci(windows): generate MSVC .lib import libraries for ffmpeg DLLs
CI run 26063971492 build-windows passed the openh264 link-test (gendef +
binutils fix landed in de0e71f) but then JamWide's MSVC link failed with
24 unresolved externals: av_packet_unref, av_freep, avcodec_find_decoder,
avcodec_send_packet, etc. — every ffmpeg API.
Root cause is the same shape as the openh264 issue. ffmpeg's MinGW
autotools install produces .dll.a (MinGW-format import libraries) that
MSVC's link.exe rejects for non-trivial decoration. Apply the same
gendef + dlltool fix pattern to every ffmpeg DLL after `make install`.
Script changes (scripts/build_ffmpeg_lgpl.sh, Windows post-process):
1. Consolidate DLLs from $PREFIX/bin/ (MinGW autotools default) into
$PREFIX/lib/ so cmake/ffmpeg.cmake finds DLLs + import libs in
one place.
2. For each *.dll in $PREFIX/lib/: gendef → .def, dlltool --output-lib
→ .lib. dlltool emits COFF that MSVC accepts for ffmpeg's C symbols.
3. Strip MinGW .dll.a files — cmake's file(GLOB) would otherwise pick
them up and MSVC fails on them anyway. The .lib files we generated
supersede.
cmake/ffmpeg.cmake WIN32 path:
- _lib_glob now signals MSVC link target (.lib) instead of runtime
binary (.dll). Two file(GLOB) variants per library — Windows ffmpeg
DLLs lack the `lib` prefix (avcodec-61.lib) while openh264 keeps it
(libopenh264.lib). Glob both patterns.
- _win32_no_libprefix flag switches the existing glob block to the
Windows naming convention; macOS/Linux paths untouched.
Same one-shot bundling pattern applies once this lane goes green:
capture libs/ffmpeg/windows-x86_64/ as artifact, commit, strip MSYS2
setup + Vendor LGPL ffmpeg from Windows CI. macOS already done.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 16de377 commit ff044ef
2 files changed
Lines changed: 78 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
135 | 141 | | |
| 142 | + | |
136 | 143 | | |
137 | 144 | | |
138 | 145 | | |
| |||
147 | 154 | | |
148 | 155 | | |
149 | 156 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
155 | 173 | | |
156 | 174 | | |
157 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
371 | 371 | | |
372 | 372 | | |
373 | 373 | | |
374 | | - | |
375 | | - | |
376 | | - | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
377 | 428 | | |
378 | 429 | | |
379 | 430 | | |
| |||
0 commit comments