2025-09-07 15:40:48 -07:00
|
|
|
Import('env')
|
2023-03-08 16:11:18 -08:00
|
|
|
|
|
|
|
|
if GetOption('kaitai'):
|
2025-09-07 15:40:48 -07:00
|
|
|
current_dir = Dir('./generated/').srcnode().abspath
|
|
|
|
|
python_cmd = f"kaitai-struct-compiler --target python --outdir {current_dir} $SOURCES"
|
|
|
|
|
env.Command(File('./generated/ubx.py'), 'ubx.ksy', python_cmd)
|
|
|
|
|
env.Command(File('./generated/gps.py'), 'gps.ksy', python_cmd)
|
|
|
|
|
env.Command(File('./generated/glonass.py'), 'glonass.ksy', python_cmd)
|
2023-03-08 16:11:18 -08:00
|
|
|
# kaitai issue: https://github.com/kaitai-io/kaitai_struct/issues/910
|
2025-09-07 15:40:48 -07:00
|
|
|
py_glonass_fix = env.Command(None, File('./generated/glonass.py'), "sed -i 's/self._io.align_to_byte()/# self._io.align_to_byte()/' $SOURCES")
|
|
|
|
|
env.Depends(py_glonass_fix, File('./generated/glonass.py'))
|