mpv/waftools
Dudemanguy 80feac62f1 command: add platform property
This returns the value of the target OS that mpv was built on as
reported by the build system. It is quite conceivable that script
writers and API users would need to make OS-dependent choices in some
cases. Such people end up writing boilerplate/hacks to guess what OS
they are on. Assuming you trust the build system (if you don't, we're in
really deep trouble), then mpv actually knows exactly what OS it was
built on. Simply take this information at configuration time, make it a
define, and let mp_property_platform return the value.

Note that mpv has two build systems (waf and meson), so the names of the
detected OSes may not be exactly the same. Since meson is the newer
build system, the value of this property follows meson's naming
conventions*. In the waf build, there is a small function to map known
naming deviations to match meson (i.e. changing "win32" to "windows").
waf's documentation is a nightmare to follow, but it seems to simply
take the output of sys.platform in python and strip away any trailing
numbers if they exist (exception being win32 and os2)*.

*: https://mesonbuild.com/Reference-tables.html#operating-system-names
*: https://waf.io/apidocs/Utils.html#waflib.Utils.unversioned_sys_platform
2023-02-27 17:13:21 +00:00
..
checks command: add platform property 2023-02-27 17:13:21 +00:00
detections build: fix macOS arm builds 2020-11-22 13:44:16 +02:00
fragments meson: move vector check inside of meson.build 2023-02-02 14:22:09 +00:00
generators file2string: remove question mark from safe chars 2020-11-22 17:16:57 +01:00
__init__.py
clang_compilation_database.py *.py: cosmetic changes 2020-02-27 21:36:21 +01:00
dependencies.py build: sort dependencies (to make build deterministic) 2020-09-18 02:02:49 +00:00
deps_parser.py build: remove some dead code 2017-09-19 18:37:11 +02:00
features.py waftools/features: add forgotten enable variants for enabled features 2021-09-20 00:43:12 +02:00
inflector.py build: lua version: sanitize id before storage (no-op) 2021-10-03 19:48:29 +03:00
syms.py build: fix build for waf 2.0 2017-09-22 09:14:37 +02:00
waf_customizations.py build: fix linking libmpv when swift features are build 2018-07-08 14:39:04 +03:00