mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-19 09:43:51 +08:00
* clang * report * safety.h * fix lines * cleaner * better * remove this * revert this * fix * tici build * revert * revert * fix
41 lines
794 B
Python
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])
|