build: Add configuration summaries

Meson now has a summary() function to easily summarize the build
configuration after the project was configured, use that for some
fancy output when the feature is available.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1072
This commit is contained in:
Florian Müllner
2020-03-05 12:44:35 +01:00
parent 5c5dc03b78
commit 04352ae158
2 changed files with 58 additions and 0 deletions

View File

@ -51,4 +51,30 @@ endif
if not meson.is_subproject()
subdir('po')
summary_dirs = {
'prefix': get_option('prefix'),
'bindir': get_option('bindir'),
'datadir': get_option('datadir'),
}
if get_option('man')
summary_dirs += { 'mandir': get_option('mandir') }
endif
summary_build = {
'buildtype': get_option('buildtype'),
'debug': get_option('debug'),
}
summary_options = {
'man': get_option('man'),
'bash_completion': bash_completion.found(),
}
if meson.version().version_compare('>= 0.53.0')
summary(summary_dirs, section: 'Directories')
summary(summary_build, section: 'Build Configuration')
summary(summary_options, section: 'Build Options')
endif
endif