def build_extensions(self):
#c = self.compiler.compiler_type
#print "compiler attr", self.compiler.__dict__
#print "compiler", self.compiler.compiler
#print "compiler is",c
try:
if compiler_is_clang(self.compiler.compiler):
for e in self.extensions:
e.extra_compile_args.append('-stdlib=libstdc++')
e.extra_compile_args.append('-Wno-unused-function')
for e in self.extensions:
e.extra_link_args.append('-stdlib=libstdc++')
except AttributeError:
pass
build_ext.build_extensions(self)
python类build_extensions()的实例源码
def build_extensions(self):
if build_concurrency > 1:
self.check_extensions_list(self.extensions)
import multiprocessing.pool
multiprocessing.pool.ThreadPool(processes=build_concurrency).map(self.build_extension, self.extensions)
else:
build_ext.build_extensions(self)
def build_extensions(self):
winpty_exts = [ext for ext in self.extensions if isinstance(ext, WinptyExtension)]
if winpty_exts:
winpty_commit_hash = check_output([cmd, '/c', r'cd winpty\src\shared && GetCommitHash.bat']).decode()
winpty_gen_include = check_output([cmd, '/c', r'cd winpty\src\shared && UpdateGenVersion.bat {}'.format(winpty_commit_hash)]).decode()
if winpty_gen_include[-2:] == '\r\n':
winpty_gen_include = winpty_gen_include[:-2]
check_call(['lib', '/nologo', '/def:winpty.def', '/out:winpty.lib'])
for ext in winpty_exts:
ext.include_dirs += ['winpty/src/{}'.format(winpty_gen_include)]
build_ext.build_extensions(self)
def build_extensions(self):
# Remove the "-Wstrict-prototypes" compiler option, which isn't valid
# for C++.
customize_compiler(self.compiler)
try:
self.compiler.compiler_so.remove('-Wstrict-prototypes')
except (AttributeError, ValueError):
pass
_build_ext.build_extensions(self)
def build_extensions(self):
self.check_cython_extensions(self.extensions)
# Include NumPy
numpy_incl = pkg_resources.resource_filename('numpy', 'core/include')
for ext in self.extensions:
if (hasattr(ext, 'include_dirs') and
numpy_incl not in ext.include_dirs):
ext.include_dirs.append(numpy_incl)
_build_ext.build_extensions(self)
def build_extensions(self):
if build_concurrency > 1:
self.check_extensions_list(self.extensions)
import multiprocessing.pool
multiprocessing.pool.ThreadPool(processes=build_concurrency).map(self.build_extension, self.extensions)
else:
build_ext.build_extensions(self)