Build log_index using scons

old-commit-hash: 845abed5db
commatwo_master
Willem Melching 5 years ago
parent 1a825681b3
commit 6993b1ecca
  1. 2
      SConstruct
  2. 3
      tools/lib/index_log/SConscript
  3. 5
      tools/lib/logreader.py

@ -249,5 +249,7 @@ if arch == "aarch64":
SConscript(['selfdrive/locationd/SConscript']) SConscript(['selfdrive/locationd/SConscript'])
SConscript(['selfdrive/locationd/kalman/SConscript']) SConscript(['selfdrive/locationd/kalman/SConscript'])
SConscript(['tools/lib/index_log/SConscript'])
# TODO: finish cereal, dbcbuilder, MPC # TODO: finish cereal, dbcbuilder, MPC

@ -0,0 +1,3 @@
Import('env', 'arch', 'messaging')
env.Program('index_log', ['index_log.cc'], LIBS=[messaging, 'kj', 'capnp'])

@ -23,9 +23,10 @@ OP_PATH = os.path.dirname(os.path.dirname(capnp_log.__file__))
def index_log(fn): def index_log(fn):
index_log_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "index_log") index_log_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "index_log")
index_log = os.path.join(index_log_dir, "index_log") index_log = os.path.join(index_log_dir, "index_log")
phonelibs_dir = os.path.join(OP_PATH, 'phonelibs')
subprocess.check_call(["make", "PHONELIBS=" + phonelibs_dir], cwd=index_log_dir, stdout=subprocess.DEVNULL) if not os.path.exists(index_log):
phonelibs_dir = os.path.join(OP_PATH, 'phonelibs')
subprocess.check_call(["make", "PHONELIBS=" + phonelibs_dir], cwd=index_log_dir, stdout=subprocess.DEVNULL)
try: try:
dat = subprocess.check_output([index_log, fn, "-"]) dat = subprocess.check_output([index_log, fn, "-"])

Loading…
Cancel
Save