本文整理汇总了Python中pypy.translator.tool.cbuild.ExternalCompilationInfo.from_linker_flags方法的典型用法代码示例。如果您正苦于以下问题:Python ExternalCompilationInfo.from_linker_flags方法的具体用法?Python ExternalCompilationInfo.from_linker_flags怎么用?Python ExternalCompilationInfo.from_linker_flags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pypy.translator.tool.cbuild.ExternalCompilationInfo
的用法示例。
在下文中一共展示了ExternalCompilationInfo.from_linker_flags方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_from_linker_flags
# 需要导入模块: from pypy.translator.tool.cbuild import ExternalCompilationInfo [as 别名]
# 或者: from pypy.translator.tool.cbuild.ExternalCompilationInfo import from_linker_flags [as 别名]
def test_from_linker_flags(self):
flags = ('-L/some/lib/path -L/other/lib/path '
'-lmylib1 -lmylib2 -?1 -!2')
eci = ExternalCompilationInfo.from_linker_flags(flags)
assert eci.libraries == ('mylib1', 'mylib2')
assert eci.library_dirs == ('/some/lib/path',
'/other/lib/path')
assert eci.link_extra == ('-?1', '-!2')
示例2: log
# 需要导入模块: from pypy.translator.tool.cbuild import ExternalCompilationInfo [as 别名]
# 或者: from pypy.translator.tool.cbuild.ExternalCompilationInfo import from_linker_flags [as 别名]
log(cmdline)
err = os.system(cmdline)
if err:
raise Exception("gcc command failed")
do("g++ -g -c '%s' -o '%s' `%s --cppflags`" % (cname, o1name, llvm_config))
do("g++ -g -c '%s' -o '%s' `%s --cppflags`" % (cppname, o2name, llvm_config))
do("g++ -g -shared '%s' '%s' -o '%s'" % (o1name, o2name, libname) +
" `%s --cflags --ldflags --libs jit engine`" % llvm_config)
ctypes_compilation_info = ExternalCompilationInfo(
library_dirs = [dirname],
libraries = ['pypy_cache_llvm'],
)
compilation_info = ExternalCompilationInfo.from_linker_flags(
os.popen("%s --ldflags --libs jit engine" % llvm_config, 'r').read())
compilation_info = compilation_info.merge(ExternalCompilationInfo(
link_extra = [o1name, o2name],
use_cpp_linker = True,
))
compilation_info._with_ctypes = ctypes_compilation_info
_teardown = None
def set_teardown_function(fn):
global _teardown
_teardown = fn
def teardown_now():