ExtensionHelper.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:urh 作者: jopohl 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号