当前位置: 首页>>代码示例>>Python>>正文


Python ExternalCompilationInfo.from_pkg_config方法代码示例

本文整理汇总了Python中rpython.translator.tool.cbuild.ExternalCompilationInfo.from_pkg_config方法的典型用法代码示例。如果您正苦于以下问题:Python ExternalCompilationInfo.from_pkg_config方法的具体用法?Python ExternalCompilationInfo.from_pkg_config怎么用?Python ExternalCompilationInfo.from_pkg_config使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rpython.translator.tool.cbuild.ExternalCompilationInfo的用法示例。


在下文中一共展示了ExternalCompilationInfo.from_pkg_config方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: try_tools

# 需要导入模块: from rpython.translator.tool.cbuild import ExternalCompilationInfo [as 别名]
# 或者: from rpython.translator.tool.cbuild.ExternalCompilationInfo import from_pkg_config [as 别名]
def try_tools():
    try:
        yield ExternalCompilationInfo.from_pkg_config("ncurses")
    except Exception:
        pass
    try:
        yield ExternalCompilationInfo.from_config_tool("ncurses5-config")
    except Exception:
        pass
开发者ID:charred,项目名称:pypy,代码行数:11,代码来源:fficurses.py

示例2: test_from_pkg_config

# 需要导入模块: from rpython.translator.tool.cbuild import ExternalCompilationInfo [as 别名]
# 或者: from rpython.translator.tool.cbuild.ExternalCompilationInfo import from_pkg_config [as 别名]
 def test_from_pkg_config(self):
     try:
         cmd = ['pkg-config', 'ncurses', '--exists']
         popen = Popen(cmd)
         result = popen.wait()
     except OSError:
         result = -1
     if result != 0:
         py.test.skip("failed: %r" % (' '.join(cmd),))
     eci = ExternalCompilationInfo.from_pkg_config('ncurses')
     assert 'ncurses' in eci.libraries
开发者ID:Darriall,项目名称:pypy,代码行数:13,代码来源:test_cbuild.py

示例3: str

# 需要导入模块: from rpython.translator.tool.cbuild import ExternalCompilationInfo [as 别名]
# 或者: from rpython.translator.tool.cbuild.ExternalCompilationInfo import from_pkg_config [as 别名]
import pixie.vm.libs.ffi as ffi
import rpython.rlib.rgc as rgc


pkgpath = py.path.local(__file__).dirpath()
srcpath = pkgpath.join("c")

shutil.copyfile(str(srcpath / "uv_ffi.c"), str(udir.udir / "uv_ffi.c"))
shutil.copyfile(str(srcpath / "uv_ffi.h"), str(udir.udir / "uv_ffi.h"))


compilation_info = ExternalCompilationInfo(
        includes=['uv.h', "ffi.h", "uv_ffi.h"],
        include_dirs=[srcpath],
        libraries=["uv", "ffi"],
        separate_module_files=[udir.udir / "uv_ffi.c"]).merge(ExternalCompilationInfo.from_pkg_config("libffi"))

def llexternal(*args, **kwargs):
    return rffi.llexternal(*args, compilation_info=compilation_info, **kwargs)


uv_work = rffi_platform.Struct("uv_work_t",
                               [("data", rffi.VOIDP)])

uv_timer_t = rffi.COpaque("uv_timer_t", compilation_info=compilation_info)
uv_baton_t = rffi.COpaque("work_baton_t", compilation_info=compilation_info)


uv_timer = lltype.Ptr(uv_timer_t)

uv_timer_cb = lltype.Ptr(lltype.FuncType([uv_timer, rffi.INT], lltype.Void))
开发者ID:andrewchambers,项目名称:pixie,代码行数:33,代码来源:uv.py


注:本文中的rpython.translator.tool.cbuild.ExternalCompilationInfo.from_pkg_config方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。