mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-10-25 06:33:09 +00:00
Autodetect bundled slangc when from from a dev.sh build
This commit is contained in:
parent
2caa3ca16b
commit
5fc4189cfd
4 changed files with 11 additions and 2 deletions
|
|
@ -41,9 +41,12 @@ _slangc: tuple[str, ...] = ()
|
|||
def slangc() -> tuple[str, ...]:
|
||||
global _slangc
|
||||
if not _slangc:
|
||||
from kitty.fast_data_types import Shlex
|
||||
from kitty.fast_data_types import DEVELOP_ROOT, Shlex
|
||||
|
||||
_slangc = tuple(Shlex(os.environ.get('SLANGC', 'slangc'), False))
|
||||
if DEVELOP_ROOT:
|
||||
_slangc = (os.path.join(DEVELOP_ROOT, 'bin', 'slangc'),)
|
||||
else:
|
||||
_slangc = tuple(Shlex(os.environ.get('SLANGC', 'slangc'), False))
|
||||
return _slangc
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1022,6 +1022,10 @@ PyInit_fast_data_types(void) {
|
|||
#ifdef KITTY_VCS_REV
|
||||
PyModule_AddStringMacro(m, KITTY_VCS_REV);
|
||||
#endif
|
||||
#ifndef DEVELOP_ROOT
|
||||
#define DEVELOP_ROOT ""
|
||||
#endif
|
||||
PyModule_AddStringMacro(m, DEVELOP_ROOT);
|
||||
PyModule_AddIntMacro(m, CURSOR_BLOCK);
|
||||
PyModule_AddIntMacro(m, CURSOR_BEAM);
|
||||
PyModule_AddIntMacro(m, CURSOR_UNDERLINE);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ from kitty.typing_compat import EdgeLiteral, NotRequired, ReadableBuffer, Writea
|
|||
# Constants {{{
|
||||
SCALE_BITS: int
|
||||
NULL_COLOR_VALUE: int
|
||||
DEVELOP_ROOT: str
|
||||
WIDTH_BITS: int
|
||||
SUBSCALE_BITS: int
|
||||
COLOR_IS_SPECIAL: int
|
||||
|
|
|
|||
1
setup.py
1
setup.py
|
|
@ -703,6 +703,7 @@ def init_env(
|
|||
|
||||
if os.environ.get('DEVELOP_ROOT'):
|
||||
cflags.insert(0, f'-I{os.environ["DEVELOP_ROOT"]}/include')
|
||||
cflags.insert(0, f'-DDEVELOP_ROOT="{os.environ["DEVELOP_ROOT"]}"')
|
||||
ldpaths.insert(0, f'-L{os.environ["DEVELOP_ROOT"]}/lib')
|
||||
|
||||
if building_arch:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue