summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-02-20 19:34:02 -0600
committerDudemanguy <random342@airmail.cc>2023-04-11 20:05:36 +0000
commit3c1686488b48bd2760e9b19f42e7d3be1363d00a (patch)
treea3976a8eb329421d0aa116423165dccc51fb4532
parentd65e56216d2bb3f2a4b65922f48192be6a691152 (diff)
downloadmpv-3c1686488b48bd2760e9b19f42e7d3be1363d00a.tar.bz2
mpv-3c1686488b48bd2760e9b19f42e7d3be1363d00a.tar.xz
meson: use the new build_options method
This finally allows us to put any user defined options into the CONFIGURATION variable like what waf does. The arbitrary hardcoded fallback is left in place for old meson versions. Also update the documentation in regards to the mpv-configuration variable to be relevant to meson.
-rw-r--r--DOCS/man/input.rst5
-rw-r--r--meson.build15
2 files changed, 12 insertions, 8 deletions
diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst
index a06cc66a05..7125b8b312 100644
--- a/DOCS/man/input.rst
+++ b/DOCS/man/input.rst
@@ -3329,8 +3329,9 @@ Property list
might contain either a release version, or just a git hash.
``mpv-configuration``
- The configuration arguments which were passed to the build system
- (typically the way ``./waf configure ...`` was invoked).
+ The configuration arguments that were passed to the build system. If the
+ meson version used to compile mpv is older than 1.1.0, then a hardcoded
+ string of a few, arbitrary options is displayed instead.
``ffmpeg-version``
The contents of the ``av_version_info()`` API call. This is a string which
diff --git a/meson.build b/meson.build
index 49c5f254e5..4aada48731 100644
--- a/meson.build
+++ b/meson.build
@@ -1613,12 +1613,15 @@ if features['pdf-build']
endif
-# 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')
+if meson.version().version_compare('>= 1.1.0')
+ configuration = meson.build_options()
+else
+ # Arbitrary hardcoded things to pass if the meson version is too
+ # old to have the build_options method.
+ configuration = 'meson configure build ' + '-Dprefix=' + get_option('prefix') + \
+ ' -Dbuildtype=' + get_option('buildtype') + \
+ ' -Doptimization=' + get_option('optimization')
+endif
# Set config.h