meson: add more hardcoded values to configuration

mpv has a CONFIGURATION define which is defined at configure time in
both build systems and printed out when you use verbose flags. In waf,
this is line is exactly what the user passes on cli at configure time.
In meson, there's currently no way to do that (someone did recently open
up a PR that would make this possible), so we just hardcode the prefix
and call it a day. This is a bit of a tangent, but the build also
copies waf and sets an optimize variable (true or false) that is also
printed out on verbose output. For waf, this makes some sense because
the build has a specific --optimize option (internally all it does is
pass -O2). In meson, optimizing is a built-in option and we just set
anything that's not -O0 as "optimize". Furthermore, there is a new
optimization option added in meson 0.64 called "plain" which passes no
flags at all* so this logic would need to be updated to account for
this.

In retrospect, this is all just stupid though. optimization is not a
boolean value and there's no real use for treating it like one just
because that's what waf does. Let's remove it from the features array.
Instead, we can expose this information in the CONFIGURATION variable
along with the prefix option so we know exactly what optimization was
used in the compiled executable. For good measure, let's also throw in
buildtype since it's related.

*: a590cfde0c
This commit is contained in:
Dudemanguy 2022-10-29 11:29:26 -05:00
parent 0fa5bfae24
commit a9e1905a4a
1 changed files with 6 additions and 6 deletions

View File

@ -44,7 +44,6 @@ features = {
'gpl': get_option('gpl'),
'jpegxl': libavformat.version().version_compare('>= 59.27.100'),
'libass': true,
'optimize': get_option('optimization') != '0',
'threads': true,
}
@ -1587,11 +1586,12 @@ if features['pdf-build']
endif
# We can't easily get every single thing a user might have passed on the cli,
# but we might as well add prefix (even if it's not specifically set) since
# it's highly relevant and useful.
configuration = 'meson configure build '
configuration += '-Dprefix=' + get_option('prefix')
# Currently, we can't easily get every single thing a user might have passed
# on the cli, but we might as well just hardcode a few options (even if they are
# not specifically set) for verbosity's sake.
configuration = 'meson configure build ' + '-Dprefix=' + get_option('prefix') + \
' -Dbuildtype=' + get_option('buildtype') + \
' -Doptimization=' + get_option('optimization')
features += {'cplayer': get_option('cplayer')}
features += {'libmpv-' + get_option('default_library'): get_option('libmpv')}