setup.py 文件源码

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

项目:bolero 作者: rock-learning 项目源码 文件源码
def configuration(parent_package='', top_path=None):
    from numpy.distutils.misc_util import Configuration

    config = Configuration("wrapper", parent_package, top_path)
    try:
        import build_info
    except ImportError:
        build_info = None
    if build_info is None:
        config.set_options(ignore_setup_xxx_py=True,
                           assume_default_configuration=True,
                           delegate_options_to_subpackages=True,
                           quiet=True)
        return config

    from Cython.Build import cythonize
    import numpy

    cythonize(cython_path("_wrapper.pyx"), language="c++")

    # CMake outputs multiple include dirs separated by ";"
    # but the setup scripts needs it as list => split it
    config.add_extension(
        '_wrapper',
        sources=["_wrapper.cpp"],  # Generated by cythonize
        include_dirs=[".",
                      numpy.get_include(),
                      build_info.BOLERO_INCLUDE_DIRS.split(";"),
                      build_info.BL_LOADER_INCLUDE_DIRS.split(";"),
                      build_info.LIB_MANAGER_INCLUDE_DIRS.split(";")],
        libraries=["bl_loader", "lib_manager"],
        library_dirs=[build_info.BL_LOADER_LIBRARY_DIRS.split(";"),
                      build_info.LIB_MANAGER_LIBRARY_DIRS.split(";")],
        define_macros=[("NDEBUG",)],
        extra_compile_args=["-O3", "-Wno-unused-function",
                            "-Wno-unused-but-set-variable",])
    return config
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号