mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-11-06 20:43:46 +08:00
22a8575199
Keep official openpilot ancestry and dependency licenses. Store resources directly in Git, remove LFS setup requirements, and leave the downloadable big model outside the source tree.
61 lines
1.4 KiB
Python
61 lines
1.4 KiB
Python
import os
|
|
import platform
|
|
import subprocess
|
|
import sysconfig
|
|
import numpy as np
|
|
import eigen
|
|
|
|
arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
|
|
|
|
common = ''
|
|
|
|
python_path = sysconfig.get_paths()['include']
|
|
cpppath = [
|
|
'#',
|
|
'#rednose',
|
|
'#rednose/examples/generated',
|
|
'/usr/lib/include',
|
|
python_path,
|
|
np.get_include(),
|
|
eigen.INCLUDE_DIR,
|
|
]
|
|
|
|
env = Environment(
|
|
ENV=os.environ,
|
|
CCFLAGS=[
|
|
"-g",
|
|
"-fPIC",
|
|
"-O2",
|
|
"-Werror=implicit-function-declaration",
|
|
"-Werror=incompatible-pointer-types",
|
|
"-Werror=int-conversion",
|
|
"-Werror=return-type",
|
|
"-Werror=format-extra-args",
|
|
"-Wshadow",
|
|
],
|
|
LIBPATH=["#rednose/examples/generated"],
|
|
CFLAGS="-std=gnu11",
|
|
CXXFLAGS="-std=c++1z",
|
|
CPPPATH=cpppath,
|
|
REDNOSE_ROOT=Dir("#").abspath,
|
|
tools=["default", "cython", "rednose_filter"],
|
|
)
|
|
|
|
# Cython build enviroment
|
|
envCython = env.Clone()
|
|
envCython["CCFLAGS"] += ["-Wno-#warnings", "-Wno-cpp", "-Wno-shadow", "-Wno-deprecated-declarations"]
|
|
|
|
envCython["LIBS"] = []
|
|
if platform.system() == "Darwin":
|
|
envCython["LINKFLAGS"] = ["-bundle", "-undefined", "dynamic_lookup"]
|
|
elif arch == "aarch64":
|
|
envCython["LINKFLAGS"] = ["-shared"]
|
|
envCython["LIBS"] = [os.path.basename(python_path)]
|
|
else:
|
|
envCython["LINKFLAGS"] = ["-pthread", "-shared"]
|
|
|
|
Export('env', 'envCython', 'common')
|
|
|
|
SConscript(['#rednose/SConscript'])
|
|
SConscript(['#examples/SConscript'])
|