From ae6a656f4963b8cc5bde13fa347cfd4b76a4d4a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 26 Mar 2021 20:34:18 +0100 Subject: [PATCH] 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(-) 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',