Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if not (self.force or newer_group(depends, ext_path, 'newer')):
log.debug("skipping '%s' extension (up-to-date)", ext.name)
return
else:
log.info("building '%s' extension", ext.name)
capabilities = CCompilerCapabilities(self.compiler)
pybase64_write_config(capabilities)
objects = list()
for simd_opt in (CCompilerCapabilities.SIMD_SSSE3,
CCompilerCapabilities.SIMD_SSE41,
CCompilerCapabilities.SIMD_SSE42,
CCompilerCapabilities.SIMD_AVX,
CCompilerCapabilities.SIMD_AVX2,
CCompilerCapabilities.SIMD_NEON32,
CCompilerCapabilities.SIMD_NEON64):
if len(simd_sources[simd_opt]) == 0:
continue
if capabilities.has(simd_opt):
objects = objects + self.compiler.compile(
simd_sources[simd_opt],
output_dir=self.build_temp,
include_dirs=ext.include_dirs,
debug=self.debug,
extra_postargs=capabilities.flags(simd_opt),
depends=ext.depends)
else:
sources = sources + simd_sources[simd_opt]
if not (self.force or newer_group(depends, ext_path, 'newer')):
log.debug("skipping '%s' extension (up-to-date)", ext.name)
return
else:
log.info("building '%s' extension", ext.name)
capabilities = CCompilerCapabilities(self.compiler)
pybase64_write_config(capabilities)
objects = list()
for simd_opt in (CCompilerCapabilities.SIMD_SSSE3,
CCompilerCapabilities.SIMD_SSE41,
CCompilerCapabilities.SIMD_SSE42,
CCompilerCapabilities.SIMD_AVX,
CCompilerCapabilities.SIMD_AVX2,
CCompilerCapabilities.SIMD_NEON32,
CCompilerCapabilities.SIMD_NEON64):
if len(simd_sources[simd_opt]) == 0:
continue
if capabilities.has(simd_opt):
objects = objects + self.compiler.compile(
simd_sources[simd_opt],
output_dir=self.build_temp,
include_dirs=ext.include_dirs,
debug=self.debug,
extra_postargs=capabilities.flags(simd_opt),
depends=ext.depends)
else:
sources = sources + simd_sources[simd_opt]
objects = objects + self.compiler.compile(
depends = sources + ext.depends
try:
simd_sources_values = simd_sources.itervalues()
except AttributeError:
simd_sources_values = simd_sources.values()
for add_sources in simd_sources_values:
depends = depends + add_sources
if not (self.force or newer_group(depends, ext_path, 'newer')):
log.debug("skipping '%s' extension (up-to-date)", ext.name)
return
else:
log.info("building '%s' extension", ext.name)
capabilities = CCompilerCapabilities(self.compiler)
pybase64_write_config(capabilities)
objects = list()
for simd_opt in (CCompilerCapabilities.SIMD_SSSE3,
CCompilerCapabilities.SIMD_SSE41,
CCompilerCapabilities.SIMD_SSE42,
CCompilerCapabilities.SIMD_AVX,
CCompilerCapabilities.SIMD_AVX2,
CCompilerCapabilities.SIMD_NEON32,
CCompilerCapabilities.SIMD_NEON64):
if len(simd_sources[simd_opt]) == 0:
continue
if capabilities.has(simd_opt):
objects = objects + self.compiler.compile(
simd_sources[simd_opt],