Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg-sys: Link EXTRALIBS for component libraries. #186

Merged
merged 1 commit into from
Jan 4, 2025

Conversation

projectgus
Copy link
Contributor

Done in separate passes to create the most compatible linker order (for each component library first the library name, then its dependencies.)

This is necessary for building with the build and build-lib-x264 and/or build-lib-x265 features enabled. These libraries are added to EXTRALIBS-avcodec in config.mak not EXTRALIBS. i.e.

EXTRALIBS=
(...)
EXTRALIBS-avdevice=-lm -latomic
EXTRALIBS-avfilter=-pthread -lm -latomic
EXTRALIBS-swscale=-lm -latomic
EXTRALIBS-postproc=-lm -latomic
EXTRALIBS-avformat=-lm -latomic
EXTRALIBS-avcodec=-pthread -lm -latomic -lx264 -lx265
EXTRALIBS-swresample=-lm -latomic
EXTRALIBS-avutil=-pthread -lm -latomic
(...)

Only tested on Linux.

Done in separate passes to create the most compatible linker order (for
each component library first the library name, then its dependencies.)

This is necessary for building with the "build" and "build-lib-x264" and/or
"build-lib-x265" features enabled, as these libraries are added to
"EXTRALIBS-avcodec" in config.mak not "EXTRALIBS".

A side effect of this implementation is that libm and libatomic are linked
multiple times on Linux as they appear in multiple sub-library link lists,
but this seems relatively harmless.

Only tested on Linux thus far.
@projectgus projectgus force-pushed the bugfix/sys_link_libx264_5 branch from cf9ed46 to 3e90dc9 Compare December 6, 2024 04:50
@kornelski kornelski merged commit 1613583 into meh:master Jan 4, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants