mirror of
https://github.com/mpv-player/mpv
synced 2025-02-19 22:36:55 +00:00
Some compiler flags were passed to mpv in order to get it to build as a
gui application on windows. However on the meson build, this always
resulted in mpv being built as a console application. This is because
the function for making executables in meson specifically has a kwarg
called win_subsystem* which defaults to 'console'. That always added
link arguments at the end which compiled mpv.exe as a console
application. The correct thing to do is to remove all of the
subsystem-related flags in the meson build and use the win_subsystem
kwarg as intended by setting it to 'windows,6.0'. For mpv.com, we can
remove the -Wl,--subsystem,console flag since meson will set this by
default in that executable. This makes mpv.exe function correctly and
open with the pseudo-gui while mpv.com acts as a console wrapper.
1a0603835e
27 lines
860 B
Meson
27 lines
860 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')
|
|
features += 'win32-executable'
|
|
wrapper_sources= '../osdep/win32-console-wrapper.c'
|
|
executable('mpv', wrapper_sources, c_args: '-municode', link_args: '-municode',
|
|
name_suffix: 'com', install: true)
|
|
endif
|