SCons: respect cache read only (#29437)

* respect readonly

* gitignore and move to correct folder

* also copy old
old-commit-hash: 59abb469ea
beeps
Justin Newberry 2 years ago committed by GitHub
parent cce2c732c6
commit 9265919881
  1. 1
      .gitignore
  2. 12
      SConstruct

1
.gitignore vendored

@ -5,6 +5,7 @@ venv/
.tags
.ipynb_checkpoints
.idea
.moc_files
.overlay_init
.overlay_consistent
.sconsign.dblite

@ -1,4 +1,5 @@
import os
import shutil
import subprocess
import sys
import sysconfig
@ -334,6 +335,17 @@ qt_flags = [
qt_env['CXXFLAGS'] += qt_flags
qt_env['LIBPATH'] += ['#selfdrive/ui']
qt_env['LIBS'] = qt_libs
# Have to respect cache-readonly
if GetOption('cache_readonly'):
local_moc_files_dir = Dir("#.moc_files").abspath
cache_moc_files_dir = cache_dir + "/moc_files"
if os.path.exists(local_moc_files_dir):
shutil.rmtree(local_moc_files_dir)
if os.path.exists(cache_moc_files_dir):
shutil.copytree(cache_moc_files_dir, local_moc_files_dir)
qt_env['QT3_MOCHPREFIX'] = local_moc_files_dir + "/moc_"
else:
qt_env['QT3_MOCHPREFIX'] = cache_dir + '/moc_files/moc_'
if GetOption("clazy"):

Loading…
Cancel
Save