meson: only build the pgo helper binary when -Db_pgo=generate

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.
This commit is contained in:
Daniel Eklöf 2021-03-26 20:34:18 +01:00
parent c6fb10863d
commit ae6a656f49
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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',