From 2d0841c62423eb8316749476c2d2eac9db25de55 Mon Sep 17 00:00:00 2001 From: Andrei Alexeyev <0x416b617269@gmail.com> Date: Sun, 17 Feb 2019 21:25:00 +0200 Subject: Improve handling of gui_app This does two things: * On windows GCC-like compilers, the subsystem is always explicitly specified (either -mwindows or -mconsole). MSVC is already explicit. * The gui_app linker flags are now added after those mandated by external dependencies. This is because some misguided libraries (such as SDL) think that hijacking `main()` and forcing `-mwindows` in link flags is clever. We must unconditionally override such misuses to let gui_app work as intended. --- mesonbuild/compilers/compilers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mesonbuild/compilers/compilers.py') diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index 65df0e7..3d4cce8 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -1578,8 +1578,8 @@ class GnuLikeCompiler(abc.ABC): return ['-Wl,--allow-shlib-undefined'] def get_gui_app_args(self, value): - if self.compiler_type.is_windows_compiler and value: - return ['-mwindows'] + if self.compiler_type.is_windows_compiler: + return ['-mwindows' if value else '-mconsole'] return [] def compute_parameters_with_absolute_paths(self, parameter_list, build_dir): -- cgit v1.1