Fix static linking to Autotools builds using CMake #412
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
autotools: Move mandatory dependencies from EXTRA_LDFLAGS to MIXER_LIBS
Autotools variables whose names end with _LDFLAGS are usually for
linker options such as -Wl,--export-dynamic which would not be
appropriate to copy into the pkg-config or CMake metadata.
Move these dependencies into a separate _LIBS variable, which is
conventionally a list of -L and -l options (only) and can be copied
into pkg-config or CMake metadata. This follows the same pattern as
IMG_LIBS and TTF_LIBS in SDL_image and SDL_ttf.
Exclude SDL_LIBS from this, because the CMake metadata has a special
case for finding SDL, and linking to a different SDL causes link failure
on our macOS CI. Link SDL via $(SDL_LIBS) instead.
sdl2_mixer-config.cmake.in: Use MIXER_LIBS for static linking
We can't rely on all mandatory dependencies being in PC_LIBS, because
if we found a dependency such as libflac via pkg-config, we would have
put the name of the pkg-config module in PC_REQUIRES instead.
Resolves: Static linking of dependent program with CMake fails in Autotools build with --disable-foo-shared #411