mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-08 21:25:32 +02:00
When kitty is built from a git checkout show the current revision in --debug-config
This commit is contained in:
4
setup.py
4
setup.py
@@ -182,6 +182,10 @@ def init_env(
|
||||
cflags = shlex.split(cflags) + shlex.split(
|
||||
sysconfig.get_config_var('CCSHARED')
|
||||
)
|
||||
if os.path.exists('.git'):
|
||||
head = open('.git/HEAD', 'r').read().split(':', 1)[-1].strip()
|
||||
rev = open('.git/' + head).read().split(':', 1)[-1].strip()
|
||||
cflags.append('-DKITTY_VCS_REV="{}"'.format(rev))
|
||||
ldflags = os.environ.get(
|
||||
'OVERRIDE_LDFLAGS',
|
||||
'-Wall ' + ' '.join(sanitize_args) + ('' if debug else ' -O3')
|
||||
|
||||
Reference in New Issue
Block a user