mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-18 17:23:52 +08:00
34 lines
735 B
Python
34 lines
735 B
Python
import platform
|
|
|
|
CC = 'gcc'
|
|
system = platform.system()
|
|
if system == 'Darwin':
|
|
# gcc installed by homebrew has version suffix (e.g. gcc-12) in order to be
|
|
# distinguishable from system one - which acts as a symlink to clang
|
|
CC += '-13'
|
|
|
|
env = Environment(
|
|
CC=CC,
|
|
CFLAGS=[
|
|
'-nostdlib',
|
|
'-fno-builtin',
|
|
'-std=gnu11',
|
|
'-Wfatal-errors',
|
|
'-Wno-pointer-to-int-cast',
|
|
'-DENABLE_LOGGING',
|
|
],
|
|
CPPPATH=[".", "../../board/"],
|
|
)
|
|
if system == "Darwin":
|
|
env.PrependENVPath('PATH', '/opt/homebrew/bin')
|
|
|
|
if GetOption('ubsan'):
|
|
flags = [
|
|
"-fsanitize=undefined",
|
|
"-fno-sanitize-recover=undefined",
|
|
]
|
|
env['CFLAGS'] += flags
|
|
env['LINKFLAGS'] += flags
|
|
|
|
env.SharedLibrary("libpanda.so", ["panda.c",])
|