Ver código fonte

Use ccache in build.py, and include ranges-v3

default_compile_flags
vector-of-bool 5 anos atrás
pai
commit
4b70fad86c
1 arquivos alterados com 12 adições e 0 exclusões
  1. +12
    -0
      tools/build.py

+ 12
- 0
tools/build.py Ver arquivo

@@ -17,6 +17,7 @@ INCLUDE_DIRS = [
'external/taywee-args/include',
'external/spdlog/include',
'external/wil/include',
'external/ranges-v3/include',
]


@@ -39,6 +40,14 @@ def is_msvc(cxx: Path) -> bool:
return (not 'clang' in cxx.name) and 'cl' in cxx.name


def have_ccache() -> bool:
try:
subprocess.check_output(['ccache', '--version'])
return True
except subprocess.CalledProcessError:
return False


def _create_compile_command(opts: BuildOptions, cpp_file: Path,
obj_file: Path) -> List[str]:
if not opts.is_msvc:
@@ -58,6 +67,8 @@ def _create_compile_command(opts: BuildOptions, cpp_file: Path,
str(cpp_file),
f'-o{obj_file}',
]
if have_ccache():
cmd.insert(0, 'ccache')
if opts.static:
cmd.append('-static')
if opts.debug:
@@ -76,6 +87,7 @@ def _create_compile_command(opts: BuildOptions, cpp_file: Path,
'/nologo',
'/EHsc',
'/std:c++latest',
'/permissive-',
'/DFMT_HEADER_ONLY=1',
f'/I{ROOT / "src"}',
str(cpp_file),

Carregando…
Cancelar
Salvar