Files
panda-meb/tests/libpanda/SConscript
Maxime Desroches fb67bda00e compile libpanda with clang (#2041)
* clang

* report

* safety.h

* fix lines

* cleaner

* better

* remove this

* revert this

* fix

* tici build

* revert

* revert

* fix
2024-09-25 20:14:12 -07:00

41 lines
794 B
Python

import os
import platform
COVERAGE_FLAGS = [
'-fprofile-instr-generate',
'-fcoverage-mapping',
]
env = Environment(
CC='clang',
CFLAGS=[
'-nostdlib',
'-fno-builtin',
'-std=gnu11',
'-Wfatal-errors',
'-Wno-pointer-to-int-cast',
],
CPPPATH=[".", "../../board/"],
)
if platform.system() == "Darwin":
env.PrependENVPath('PATH', '/opt/homebrew/bin')
TICI = os.path.isfile('/TICI')
AGNOS = TICI
if AGNOS:
env['CC'] = 'gcc'
else:
env['CFLAGS'] += COVERAGE_FLAGS
env['LINKFLAGS'] += COVERAGE_FLAGS
if GetOption('ubsan'):
flags = [
"-fsanitize=undefined",
"-fno-sanitize-recover=undefined",
]
env['CFLAGS'] += flags
env['LINKFLAGS'] += flags
panda = env.SharedObject("panda.os", "panda.c")
libpanda = env.SharedLibrary("libpanda.so", [panda])