meson: replace log+debug+xmalloc static libraries with a single ‘common’ library

There are cyclic dependencies between the log, debug and xmalloc
libraries. While having them as separate static libraries work, as
long as consumers of them link against all of them, having them in a
single library feels slightly better.
This commit is contained in:
Daniel Eklöf 2021-03-27 13:17:43 +01:00
parent 9786197d03
commit b5ceed7b2b
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -117,11 +117,13 @@ version = custom_target(
output: 'version.h',
command: [generate_version_sh, meson.project_version(), '@SOURCE_ROOT@', '@OUTPUT@'])
log = static_library('log', 'log.c', 'log.h')
debug = static_library('debug', 'debug.c', 'debug.h')
xmalloc = static_library(
'xmalloc', 'xmalloc.c', 'xmalloc.h', 'xsnprintf.c', 'xsnprintf.h')
common = static_library(
'common',
'log.c', 'log.h',
'debug.c', 'debug.h',
'xmalloc.c', 'xmalloc.h',
'xsnprintf.c', 'xsnprintf.h'
)
misc = static_library(
'misc',
@ -142,7 +144,7 @@ vtlib = static_library(
wl_proto_src + wl_proto_headers,
version,
dependencies: [libepoll, pixman, fcft, tllist, wayland_client],
link_with: [log, debug, misc, xmalloc],
link_with: [common, misc],
)
pgolib = static_library(
@ -203,7 +205,7 @@ executable(
'macros.h',
'util.h',
version,
link_with: [log, debug, xmalloc],
link_with: common,
install: true)
if tic.found()