Import('env', 'arch', 'cereal', 'messaging', 'common', 'gpucommon', 'visionipc', 'USE_WEBCAM')

libs = ['m', 'pthread', common, 'jpeg', 'OpenCL', 'yuv', cereal, messaging, 'zmq', 'capnp', 'kj', visionipc, gpucommon]

cameras = []
if arch == "larch64":
  libs += ['atomic']
  cameras = ['cameras/camera_qcom2.cc']

  env.Program('camerad', [
      'main.cc',
      'cameras/camera_common.cc',
      'imgproc/utils.cc',
      cameras,
    ], LIBS=libs)

if GetOption("test"):
  env.Program('test/ae_gray_test', [
      'test/ae_gray_test.cc',
      'cameras/camera_common.cc',
    ], LIBS=libs)
