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


Python _CONFIG_VARS.update方法代码示例

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


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

示例1: setup_shlib_compiler

# 需要导入模块: from sysconfig import _CONFIG_VARS [as 别名]
# 或者: from sysconfig._CONFIG_VARS import update [as 别名]
def setup_shlib_compiler(self):
        compiler = self.shlib_compiler = new_compiler(
            compiler=self.compiler, dry_run=self.dry_run, force=self.force
        )
        if sys.platform == "darwin":
            tmp = _CONFIG_VARS.copy()
            try:
                # XXX Help!  I don't have any idea whether these are right...
                _CONFIG_VARS['LDSHARED'] = (
                    "gcc -Wl,-x -dynamiclib -undefined dynamic_lookup")
                _CONFIG_VARS['CCSHARED'] = " -dynamiclib"
                _CONFIG_VARS['SO'] = ".dylib"
                customize_compiler(compiler)
            finally:
                _CONFIG_VARS.clear()
                _CONFIG_VARS.update(tmp)
        else:
            customize_compiler(compiler)

        if self.include_dirs is not None:
            compiler.set_include_dirs(self.include_dirs)
        if self.define is not None:
            # 'define' option is a list of (name,value) tuples
            for (name, value) in self.define:
                compiler.define_macro(name, value)
        if self.undef is not None:
            for macro in self.undef:
                compiler.undefine_macro(macro)
        if self.libraries is not None:
            compiler.set_libraries(self.libraries)
        if self.library_dirs is not None:
            compiler.set_library_dirs(self.library_dirs)
        if self.rpath is not None:
            compiler.set_runtime_library_dirs(self.rpath)
        if self.link_objects is not None:
            compiler.set_link_objects(self.link_objects)

        # hack so distutils' build_extension() builds a library instead
        compiler.link_shared_object = link_shared_object.__get__(compiler) 
开发者ID:jpush,项目名称:jbox,代码行数:41,代码来源:build_ext.py

示例2: setup_shlib_compiler

# 需要导入模块: from sysconfig import _CONFIG_VARS [as 别名]
# 或者: from sysconfig._CONFIG_VARS import update [as 别名]
def setup_shlib_compiler(self):
        compiler = self.shlib_compiler = new_compiler(
            compiler=self.compiler, dry_run=self.dry_run, force=self.force
        )
        if sys.platform == "darwin":
            tmp = _CONFIG_VARS.copy()
            try:
                # XXX Help!  I don't have any idea whether these are right...
                _CONFIG_VARS['LDSHARED'] = "gcc -Wl,-x -dynamiclib -undefined dynamic_lookup"
                _CONFIG_VARS['CCSHARED'] = " -dynamiclib"
                _CONFIG_VARS['SO'] = ".dylib"
                customize_compiler(compiler)
            finally:
                _CONFIG_VARS.clear()
                _CONFIG_VARS.update(tmp)
        else:
            customize_compiler(compiler)

        if self.include_dirs is not None:
            compiler.set_include_dirs(self.include_dirs)
        if self.define is not None:
            # 'define' option is a list of (name,value) tuples
            for (name,value) in self.define:
                compiler.define_macro(name, value)
        if self.undef is not None:
            for macro in self.undef:
                compiler.undefine_macro(macro)
        if self.libraries is not None:
            compiler.set_libraries(self.libraries)
        if self.library_dirs is not None:
            compiler.set_library_dirs(self.library_dirs)
        if self.rpath is not None:
            compiler.set_runtime_library_dirs(self.rpath)
        if self.link_objects is not None:
            compiler.set_link_objects(self.link_objects)

        # hack so distutils' build_extension() builds a library instead
        compiler.link_shared_object = link_shared_object.__get__(compiler) 
开发者ID:MayOneUS,项目名称:pledgeservice,代码行数:40,代码来源:build_ext.py


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