Explorar el Código

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

default_compile_flags
vector-of-bool hace 5 años
padre
commit
4b70fad86c
Se han modificado 1 ficheros con 12 adiciones y 0 borrados
  1. +12
    -0
      tools/build.py

+ 12
- 0
tools/build.py Ver fichero

@@ -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),

Cargando…
Cancelar
Guardar