Move parsing of macos-launch-services-cmdline into native code

Avoids expensive re-exec and simplifies various things. Much faster
for single instance usage.
This commit is contained in:
Kovid Goyal 2025-04-25 14:39:36 +05:30
parent 639ad3e8a6
commit 7bd7709685
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
10 changed files with 186 additions and 107 deletions

View file

@ -1345,7 +1345,7 @@ def build_launcher(args: Options, launcher_dir: str = '.', bundle_type: str = 's
objects = []
cppflags.append('-DKITTY_CLI_BOOL_OPTIONS=" ' + ' '.join(kitty_cli_boolean_options()) + ' "')
cppflags.append('-DKITTY_VERSION="' + '.'.join(map(str, version)) + '"')
for src in ('kitty/launcher/main.c', 'kitty/launcher/single-instance.c'):
for src in ('kitty/launcher/main.c', 'kitty/launcher/single-instance.c', 'kitty/launcher/cmdline.c'):
obj = os.path.join(build_dir, src.replace('/', '-').replace('.c', '.o'))
objects.append(obj)
cmd = env.cc + cppflags + cflags + ['-c', src, '-o', obj]