From 9b20764f35094963ecbfc40a972ef54443630447 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Fri, 26 Mar 2021 20:30:13 +0100 Subject: features: --version now logs +/-pgo That is, whether the binary was compiled with PGO or not. --- meson.build | 3 +++ 1 file changed, 3 insertions(+) (limited to 'meson.build') diff --git a/meson.build b/meson.build index 01f27be9..e1b23102 100644 --- a/meson.build +++ b/meson.build @@ -24,6 +24,9 @@ add_project_arguments( (get_option('ime') ? ['-DFOOT_IME_ENABLED=1'] : []) + + (get_option('b_pgo') == 'use' + ? ['-DFOOT_PGO_ENABLED=1'] + : []) + cc.get_supported_arguments( ['-pedantic', '-fstrict-aliasing', -- cgit v1.3 From c6fb10863d0f985c1b9eb6a859086e761d393547 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Fri, 26 Mar 2021 20:31:09 +0100 Subject: meson: build source files common to both foot and footclient as libraries Source files used by both foot and footclient are now compiled as static libraries, which foot and footclient links against. --- meson.build | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index e1b23102..237d99c6 100644 --- a/meson.build +++ b/meson.build @@ -117,16 +117,18 @@ 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') + misc = static_library( 'misc', - 'debug.c', 'debug.h', 'hsl.c', 'hsl.h', - 'log.c', 'log.h', 'macros.h', 'misc.c', 'misc.h', - 'uri.c', 'uri.h', - 'xmalloc.c', 'xmalloc.h', - 'xsnprintf.c', 'xsnprintf.h', + 'uri.c', 'uri.h' ) vtlib = static_library( @@ -140,7 +142,7 @@ vtlib = static_library( wl_proto_src + wl_proto_headers, version, dependencies: [libepoll, pixman, fcft, tllist, wayland_client], - link_with: misc, + link_with: [log, debug, misc, xmalloc], ) pgolib = static_library( @@ -195,14 +197,11 @@ executable( executable( 'footclient', 'client.c', 'client-protocol.h', - 'debug.c', 'debug.h', 'foot-features.h', - 'log.c', 'log.h', 'macros.h', 'util.h', - 'xmalloc.c', 'xmalloc.h', - 'xsnprintf.c', 'xsnprintf.h', version, + link_with: [log, debug, xmalloc], install: true) if tic.found() -- cgit v1.3 From ae6a656f4963b8cc5bde13fa347cfd4b76a4d4a5 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Fri, 26 Mar 2021 20:34:18 +0100 Subject: meson: only build the pgo helper binary when -Db_pgo=generate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is the only time it’s needed. In non-PGO builds, it is completely unnecessary, and we’re only wasting CPU cycles building it. In full PGO builds, with -Db_pgo=use, we get link warnings and/or failures, depending on compiler, since the pgo binary hasn’t been executed. --- meson.build | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index 237d99c6..54e5b315 100644 --- a/meson.build +++ b/meson.build @@ -155,13 +155,15 @@ pgolib = static_library( link_with: vtlib, ) -executable( - 'pgo', - 'pgo/pgo.c', - wl_proto_src + wl_proto_headers, - dependencies: [math, threads, libepoll, pixman, wayland_client, fcft, tllist], - link_with: pgolib, -) +if get_option('b_pgo') == 'generate' + executable( + 'pgo', + 'pgo/pgo.c', + wl_proto_src + wl_proto_headers, + dependencies: [math, threads, libepoll, pixman, wayland_client, fcft, tllist], + link_with: pgolib, + ) +endif executable( 'foot', -- cgit v1.3 From b5ceed7b2bfa41584e17d156ecac231dde195798 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 27 Mar 2021 13:17:43 +0100 Subject: meson: replace log+debug+xmalloc static libraries with a single ‘common’ library 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(-) (limited to 'meson.build') 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() -- cgit v1.3