aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2017-05-13 13:31:49 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2017-05-13 22:58:06 +0300
commit61a145fcb5c2042900b63773516168aa58b2c708 (patch)
treec6ab92f3666d979f78dc37672749cb545be51de3
parentc2282f93824f2f983ea05aace3e3409c897f4384 (diff)
downloadmeson-61a145fcb5c2042900b63773516168aa58b2c708.zip
meson-61a145fcb5c2042900b63773516168aa58b2c708.tar.gz
meson-61a145fcb5c2042900b63773516168aa58b2c708.tar.bz2
Implement executable(gui_app:) for gcc on Windows
Note that gui_app: is currently ignored when using the ninja backend with VS compilers, so I guess you get the default linker behaviour, which the documentation says is guessing the subsystem depending on if a main or WinMain symbol exists...
-rw-r--r--mesonbuild/backend/ninjabackend.py3
-rw-r--r--mesonbuild/compilers.py4
2 files changed, 7 insertions, 0 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 4885f4b..0e8e862 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -2170,6 +2170,9 @@ rule FORTRAN_DEP_HACK
if isinstance(target, build.Executable):
# Currently only used with the Swift compiler to add '-emit-executable'
commands += linker.get_std_exe_link_args()
+ # If gui_app, and that's significant on this platform
+ if target.gui_app and hasattr(linker, 'get_gui_app_args'):
+ commands += linker.get_gui_app_args()
elif isinstance(target, build.SharedLibrary):
if isinstance(target, build.SharedModule):
commands += linker.get_std_shared_module_link_args()
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index 199bbab..fa06ae9 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -2461,6 +2461,10 @@ class GnuCompiler:
# For other targets, discard the .def file.
return []
+ def get_gui_app_args(self):
+ if self.gcc_type in (GCC_CYGWIN, GCC_MINGW):
+ return ['-mwindows']
+ return []
class GnuCCompiler(GnuCompiler, CCompiler):
def __init__(self, exelist, version, gcc_type, is_cross, exe_wrapper=None, defines=None):