From b5ceed7b2bfa41584e17d156ecac231dde195798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 27 Mar 2021 13:17:43 +0100 Subject: [PATCH] =?UTF-8?q?meson:=20replace=20log+debug+xmalloc=20static?= =?UTF-8?q?=20libraries=20with=20a=20single=20=E2=80=98common=E2=80=99=20l?= =?UTF-8?q?ibrary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- meson.build | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index 54e5b315..9fbf99a6 100644 --- a/meson.build +++ b/meson.build @@ -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()