CORE = Extension(name='gevent.core', sources=['gevent/gevent.corecext.c'], include_dirs=['libev'] if LIBEV_EMBED else [], libraries=libraries, define_macros=define_macros, depends=expand('gevent/callbacks.*', 'gevent/stathelper.c', 'gevent/libev*.h', 'libev/*.*')) # QQQ libev can also use -lm, however it seems to be added implicitly ARES = Extension(name='gevent.ares', sources=['gevent/gevent.ares.c'], include_dirs=['c-ares'] if CARES_EMBED else [], libraries=libraries, define_macros=define_macros, depends=expand('gevent/dnshelper.c', 'gevent/cares_*.*')) ARES.optional = True def make_universal_header(filename, *defines): defines = [('#define %s ' % define, define) for define in defines] with open(filename, 'r') as f: lines = f.read().split('\n') ifdef = 0 with open(filename, 'w') as f: for line in lines: if line.startswith('#ifdef'): ifdef += 1 elif line.startswith('#endif'): ifdef -= 1 elif not ifdef: for prefix, define in defines:
def create_ext(**kwargs): optional = kwargs.pop('optional', True) ext = Extension(**kwargs) ext.optional = optional return ext
def create_ext(**kwargs): optional = kwargs.pop("optional", False) ext = Extension(**kwargs) ext.optional = optional return ext
f.write('""" \\\n') f.write(' + "====="\n') pybase64_ext = Extension( "pybase64._pybase64", [ "pybase64/_pybase64.c", "pybase64/_pybase64_get_simd_flags.c", "base64/lib/lib.c", "base64/lib/codec_choose.c", "base64/lib/arch/generic/codec.c" ], include_dirs=["base64/include/", "base64/lib/"], ) pybase64_ext.optional = environ.get('CIBUILDWHEEL', '0') != '1' pybase64_ext.sources_ssse3 = ["base64/lib/arch/ssse3/codec.c"] pybase64_ext.sources_sse41 = ["base64/lib/arch/sse41/codec.c"] pybase64_ext.sources_sse42 = ["base64/lib/arch/sse42/codec.c"] pybase64_ext.sources_avx = ["base64/lib/arch/avx/codec.c"] pybase64_ext.sources_avx2 = ["base64/lib/arch/avx2/codec.c"] pybase64_ext.sources_neon32 = ["base64/lib/arch/neon32/codec.c"] pybase64_ext.sources_neon64 = ["base64/lib/arch/neon64/codec.c"] def pybase64_write_config(capabilities): log.info("creating 'base64/lib/config.h'") with open(path.join(here, 'base64/lib/config.h'), mode='wt') as f: f.write('\n#define HAVE_SSSE3 %i' % capabilities.has(CCompilerCapabilities.SIMD_SSSE3))