openpilot is an open source driver assistance system. openpilot performs the functions of Automated Lane Centering and Adaptive Cruise Control for over 200 supported car makes and models.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
921 B

import SCons
from SCons.Action import Action
cythonAction = Action("$CYTHONCOM")
def create_builder(env):
4 years ago
try:
cython = env['BUILDERS']['Cython']
except KeyError:
cython = SCons.Builder.Builder(
action = cythonAction,
emitter = {},
suffix = cython_suffix_emitter,
single_source = 1
)
env['BUILDERS']['Cython'] = cython
return cython
def cython_suffix_emitter(env, source):
4 years ago
return "$CYTHONCFILESUFFIX"
def generate(env):
4 years ago
env["CYTHON"] = "cythonize"
env["CYTHONCOM"] = "$CYTHON $CYTHONFLAGS $SOURCE"
env["CYTHONCFILESUFFIX"] = ".cpp"
4 years ago
c_file, _ = SCons.Tool.createCFileBuilders(env)
4 years ago
c_file.suffix['.pyx'] = cython_suffix_emitter
c_file.add_action('.pyx', cythonAction)
4 years ago
c_file.suffix['.py'] = cython_suffix_emitter
c_file.add_action('.py', cythonAction)
4 years ago
create_builder(env)
def exists(env):
return True