|
|
|
@ -2,9 +2,9 @@ import os |
|
|
|
|
import shutil |
|
|
|
|
import subprocess |
|
|
|
|
import sys |
|
|
|
|
import sysconfig |
|
|
|
|
import platform |
|
|
|
|
import numpy as np |
|
|
|
|
from sysconfig import get_paths |
|
|
|
|
|
|
|
|
|
TICI = os.path.isfile('/TICI') |
|
|
|
|
Decider('MD5-timestamp') |
|
|
|
@ -124,10 +124,6 @@ else: |
|
|
|
|
# change pythonpath to this |
|
|
|
|
lenv["PYTHONPATH"] = Dir("#").path |
|
|
|
|
|
|
|
|
|
#Get the path for Python.h for cython linking |
|
|
|
|
python_path = get_paths()['include'] |
|
|
|
|
numpy_path = np.get_include() |
|
|
|
|
|
|
|
|
|
env = Environment( |
|
|
|
|
ENV=lenv, |
|
|
|
|
CCFLAGS=[ |
|
|
|
@ -188,9 +184,13 @@ env = Environment( |
|
|
|
|
"#selfdrive/common", |
|
|
|
|
], |
|
|
|
|
CYTHONCFILESUFFIX=".cpp", |
|
|
|
|
tools=["default", "cython"] |
|
|
|
|
COMPILATIONDB_USE_ABSPATH=True, |
|
|
|
|
tools=["default", "cython", "compilation_db"], |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
if GetOption('test'): |
|
|
|
|
env.CompilationDatabase('compile_commands.json') |
|
|
|
|
|
|
|
|
|
if os.environ.get('SCONS_CACHE'): |
|
|
|
|
cache_dir = '/tmp/scons_cache' |
|
|
|
|
|
|
|
|
@ -231,22 +231,20 @@ def abspath(x): |
|
|
|
|
return x[0].path.rsplit("/", 1)[1][:-3] |
|
|
|
|
|
|
|
|
|
# Cython build enviroment |
|
|
|
|
py_include = sysconfig.get_paths()['include'] |
|
|
|
|
envCython = env.Clone() |
|
|
|
|
envCython["CPPPATH"] += [python_path, numpy_path] |
|
|
|
|
envCython["CPPPATH"] += [py_include, np.get_include()] |
|
|
|
|
envCython["CCFLAGS"] += ["-Wno-#warnings", "-Wno-deprecated-declarations"] |
|
|
|
|
|
|
|
|
|
python_libs = [] |
|
|
|
|
envCython["LIBS"] = [] |
|
|
|
|
if arch == "Darwin": |
|
|
|
|
envCython["LINKFLAGS"] = ["-bundle", "-undefined", "dynamic_lookup"] |
|
|
|
|
elif arch == "aarch64": |
|
|
|
|
envCython["LINKFLAGS"] = ["-shared"] |
|
|
|
|
|
|
|
|
|
python_libs.append(os.path.basename(python_path)) |
|
|
|
|
envCython["LIBS"] = os.path.basename(py_include) |
|
|
|
|
else: |
|
|
|
|
envCython["LINKFLAGS"] = ["-pthread", "-shared"] |
|
|
|
|
|
|
|
|
|
envCython["LIBS"] = python_libs |
|
|
|
|
|
|
|
|
|
Export('envCython') |
|
|
|
|
|
|
|
|
|
# still needed for apks |
|
|
|
@ -306,3 +304,4 @@ if arch != "Darwin": |
|
|
|
|
|
|
|
|
|
if arch == "x86_64": |
|
|
|
|
SConscript(['tools/lib/index_log/SConscript']) |
|
|
|
|
|
|
|
|
|