aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2023-07-19 14:37:03 -0700
committerEli Schwartz <eschwartz93@gmail.com>2023-07-25 13:29:08 -0400
commit1a182ab59919d4838613f9d1962623447636663e (patch)
treede4ca57c8bf7eecccb68d99785fb2f5ed70f6d35 /mesonbuild/interpreter
parent1cfbe5279db3e5195b3f71c33960daf5afbd0425 (diff)
downloadmeson-1a182ab59919d4838613f9d1962623447636663e.zip
meson-1a182ab59919d4838613f9d1962623447636663e.tar.gz
meson-1a182ab59919d4838613f9d1962623447636663e.tar.bz2
make 'gui_app' an interpreter only concept
Since it's deprecated anyway, we don't really want to plumb it all the way down into the build and backend layers. Instead, we can just turn it into a `win_subsystem` value in the interpreter if `win_subsystem` isn't already set.
Diffstat (limited to 'mesonbuild/interpreter')
-rw-r--r--mesonbuild/interpreter/interpreter.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index 125562f..67203bd 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -3280,6 +3280,18 @@ class Interpreter(InterpreterBase, HoldableObject):
outputs.update(o)
kwargs['include_directories'] = self.extract_incdirs(kwargs)
+
+ if targetclass is build.Executable:
+ if kwargs['gui_app'] is not None:
+ if kwargs['win_subsystem'] is not None:
+ raise InvalidArguments.from_node(
+ 'Executable got both "gui_app", and "win_subsystem" arguments, which are mutually exclusive',
+ node=node)
+ if kwargs['gui_app']:
+ kwargs['win_subsystem'] = 'windows'
+ if kwargs['win_subsystem'] is None:
+ kwargs['win_subsystem'] = 'console'
+
target = targetclass(name, self.subdir, self.subproject, for_machine, srcs, struct, objs,
self.environment, self.compilers[for_machine], kwargs)