Allow simple_cli_definitions to be run on ASAN builds
This commit is contained in:
parent
c05e49a78e
commit
7e962f48fc
2 changed files with 8 additions and 8 deletions
|
|
@ -10,19 +10,17 @@
|
|||
from functools import lru_cache
|
||||
from typing import Any, Iterator, NamedTuple, Sequence
|
||||
|
||||
try:
|
||||
from kitty.constants import appname, is_macos
|
||||
except ImportError:
|
||||
if getattr(sys, 'running_from_setup', False):
|
||||
is_macos = 'darwin' in sys.platform.lower()
|
||||
try:
|
||||
from kitty.utils import shlex_split as ksplit
|
||||
def shlex_split(text: str) -> Iterator[str]:
|
||||
yield from ksplit(text)
|
||||
except ImportError:
|
||||
from shlex import split as psplit
|
||||
|
||||
def shlex_split(text: str) -> Iterator[str]:
|
||||
yield from psplit(text)
|
||||
else:
|
||||
from kitty.constants import appname, is_macos
|
||||
from kitty.utils import shlex_split as ksplit
|
||||
def shlex_split(text: str) -> Iterator[str]:
|
||||
yield from ksplit(text)
|
||||
|
||||
|
||||
def serialize_as_go_string(x: str) -> str:
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -1128,6 +1128,7 @@ def build_ref_map(skip_generation: bool = False) -> str:
|
|||
def build_cli_parser_specs(skip_generation: bool = False) -> str:
|
||||
dest = 'kitty/launcher/cli-parser-data_generated.h'
|
||||
if not skip_generation:
|
||||
setattr(sys, 'running_from_setup', True)
|
||||
m = runpy.run_path('kitty/simple_cli_definitions.py', {'appname': appname})
|
||||
h = '\n'.join(m['generate_c_parsers']())
|
||||
update_if_changed(dest, h)
|
||||
|
|
@ -1196,6 +1197,7 @@ def wrapped_kittens() -> str:
|
|||
def build(args: Options, native_optimizations: bool = True, call_init: bool = True) -> None:
|
||||
if call_init:
|
||||
init_env_from_args(args, native_optimizations)
|
||||
|
||||
sources, headers = find_c_files()
|
||||
headers.append(build_ref_map(args.skip_code_generation))
|
||||
headers.append(build_cli_parser_specs(args.skip_code_generation))
|
||||
|
|
|
|||
Loading…
Reference in a new issue