def get_device_extension(dev_name: str, libraries: list, library_dirs: list, include_dirs: list, use_cython=False):
try:
language = DEVICES[dev_name]["language"]
except KeyError:
language = "c++"
file_ext = "pyx" if use_cython else "cpp" if language == "c++" else "c"
cur_dir = os.path.dirname(os.path.realpath(__file__))
if USE_RELATIVE_PATHS:
# We need relative paths on windows
cpp_file_path = "src/urh/dev/native/lib/{0}.{1}".format(dev_name, file_ext)
else:
cpp_file_path = os.path.join(cur_dir, "lib", "{0}.{1}".format(dev_name, file_ext))
return Extension("urh.dev.native.lib." + dev_name,
[cpp_file_path],
libraries=libraries, library_dirs=library_dirs,
include_dirs=include_dirs, language=language)
评论列表
文章目录