mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-20 08:42:11 +08:00
5bfae8d806
12aad06e no more c capnp 0050e0ac stockFcw event 2c325ed3 gasPressed event 8573a24d don't duplicate ordinals 3f384efa add carState.steerWarning and carState.steerError 8b347b0a add repeated warning2 3adb8991 add sharpness metric 65af4368 Add relayMalfunction alert 442e914d add preview driver flag c8e5db83 Add comment to faulttype 975a633b Add all panda fault types to health 93ccbcb7 UiLayoutState: add mockEngaged for onboarding 9dbbb545 UiLayoutState: add 'none' app c820f83d Add offroadLayout service e370f795 Add the laneChangeBlocked Event (#40) 35040fe6 Update service documentation (#39) 8f13dfca Additional car params auto-detection in support of VW (#38) 22986de4 add speedTooHigh alert f515e4db Add invalid lkas setting alert 59087620 gnustl_shared is only for android b0c746b1 solve by renaming event name instead of service df82a53c the service is called androidLogEntry git-subtree-dir: cereal git-subtree-split: 12aad06e12f249e57abda1664fb0c85e484a0c5d
58 lines
1.6 KiB
Python
58 lines
1.6 KiB
Python
import os
|
|
import subprocess
|
|
import sysconfig
|
|
from distutils.core import Extension, setup # pylint: disable=import-error,no-name-in-module
|
|
|
|
from Cython.Build import cythonize
|
|
from Cython.Distutils import build_ext
|
|
|
|
|
|
def get_ext_filename_without_platform_suffix(filename):
|
|
name, ext = os.path.splitext(filename)
|
|
ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
|
|
|
|
if ext_suffix == ext:
|
|
return filename
|
|
|
|
ext_suffix = ext_suffix.replace(ext, '')
|
|
idx = name.find(ext_suffix)
|
|
|
|
if idx == -1:
|
|
return filename
|
|
else:
|
|
return name[:idx] + ext
|
|
|
|
|
|
class BuildExtWithoutPlatformSuffix(build_ext):
|
|
def get_ext_filename(self, ext_name):
|
|
filename = super().get_ext_filename(ext_name)
|
|
return get_ext_filename_without_platform_suffix(filename)
|
|
|
|
|
|
sourcefiles = ['messaging_pyx.pyx']
|
|
extra_compile_args = ["-std=c++11"]
|
|
libraries = ['zmq']
|
|
ARCH = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip() # pylint: disable=unexpected-keyword-arg
|
|
|
|
if ARCH == "aarch64" and os.path.isdir("/system"):
|
|
# android
|
|
extra_compile_args += ["-Wno-deprecated-register"]
|
|
libraries += ['gnustl_shared']
|
|
|
|
setup(name='CAN parser',
|
|
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
|
|
ext_modules=cythonize(
|
|
Extension(
|
|
"messaging_pyx",
|
|
language="c++",
|
|
sources=sourcefiles,
|
|
extra_compile_args=extra_compile_args,
|
|
libraries=libraries,
|
|
extra_objects=[
|
|
os.path.join(os.path.dirname(os.path.realpath(__file__)), '../', 'libmessaging.a'),
|
|
]
|
|
)
|
|
),
|
|
nthreads=4,
|
|
)
|