mirror of
https://github.com/mpv-player/mpv
synced 2024-12-28 01:52:19 +00:00
f295d39f5c
mpv has a ton of defines that are generated during building. Previously, the meson build just had this as a big giant wall of text that manually set each one but we can do this smarter. Instead, change the "features" object to a dictionary and have it hold the name of the feature and its value (true/false on whether it is enabled). Then at the end, just loop through it and reformat the name of the feature so it becomes HAVE_FEATURE. A side effect of this is that a lot of extra defines are generated that aren't actually used in the code, but the waf build worked like this for years anyway. A nice result of this is that the use of foo['use'] internally can be completely eliminated and replaced with feature['foo'] instead when needed.
26 lines
825 B
Meson
26 lines
825 B
Meson
ebml_defs = custom_target('ebml_defs.inc',
|
|
output: 'ebml_defs.inc',
|
|
command: [matroska, '--generate-definitions', '@OUTPUT@'],
|
|
)
|
|
|
|
ebml_types = custom_target('ebml_types.h',
|
|
output: 'ebml_types.h',
|
|
command: [matroska, '--generate-header', '@OUTPUT@'],
|
|
)
|
|
|
|
version_h = custom_target('version.h',
|
|
output: 'version.h',
|
|
command: [version_py, '@OUTPUT@'],
|
|
build_always_stale: true,
|
|
)
|
|
|
|
sources += [ebml_defs, ebml_types, version_h]
|
|
|
|
# Meson doesn't allow having multiple build targets with the same name in the same file.
|
|
# Just generate the com in here for windows builds.
|
|
if win32 and get_option('cplayer')
|
|
wrapper_sources= '../osdep/win32-console-wrapper.c'
|
|
executable('mpv', wrapper_sources, c_args: '-municode', link_args: '-municode',
|
|
name_suffix: 'com', install: true)
|
|
endif
|