Hash :
99f87a71
Author :
Date :
2020-04-11T23:38:34
build: Merge pkg-config Libs.private into Libs for static-only builds A project being built entirely statically will call pkg-config with --static, which utilises the Libs.private field. Conversely it will not use --static when not being built entirely statically, even if there is only a static build of SDL available. This will most likely cause the build to fail due to underlinking unless we merge the Libs fields. This is what the Meson build system does when it generates pkg-config files. This also also follows the behaviour of sdl2-config. At the same time, the runtime linker flags are not applicable to static-only builds so only add them for shared builds.
# sdl pkg-config source file
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: sdl2
Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.
Version: @SDL_VERSION@
Requires:
Conflicts:
Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@ @PKG_CONFIG_LIBS_PRIV@ @SDL_STATIC_LIBS@
Cflags: -I${includedir}/SDL2 @SDL_CFLAGS@