mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 19:21:38 +02:00
Forgot the key the is_gcc cache by cc
This commit is contained in:
15
setup.py
15
setup.py
@@ -17,7 +17,7 @@ import sysconfig
|
|||||||
import tempfile
|
import tempfile
|
||||||
import time
|
import time
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
from functools import partial
|
from functools import lru_cache, partial
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import (
|
from typing import (
|
||||||
Callable, Dict, Iterable, Iterator, List, NamedTuple, Optional, Sequence,
|
Callable, Dict, Iterable, Iterator, List, NamedTuple, Optional, Sequence,
|
||||||
@@ -290,11 +290,14 @@ int main(void) {
|
|||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|
||||||
def is_gcc(cc: List[str]) -> bool:
|
def is_gcc(cc: Iterable[str]) -> bool:
|
||||||
if not hasattr(is_gcc, 'ans'):
|
|
||||||
raw = subprocess.check_output(cc + ['--version']).decode('utf-8').splitlines()[0]
|
@lru_cache
|
||||||
setattr(is_gcc, 'ans', '(GCC)' in raw.split())
|
def f(cc: Tuple[str]) -> bool:
|
||||||
return bool(getattr(is_gcc, 'ans'))
|
raw = subprocess.check_output(cc + ('--version',)).decode('utf-8').splitlines()[0]
|
||||||
|
return '(GCC)' in raw.split()
|
||||||
|
|
||||||
|
return f(tuple(cc))
|
||||||
|
|
||||||
|
|
||||||
def init_env(
|
def init_env(
|
||||||
|
|||||||
Reference in New Issue
Block a user