mirror of
https://github.com/python/cpython.git
synced 2025-10-14 02:43:49 +00:00
bpo-11063, bpo-20519: avoid ctypes and improve import time for uuid (#3796)
bpo-11063, bpo-20519: avoid ctypes and improve import time for uuid.
This commit is contained in:
parent
8d59aca4a9
commit
a106aec2ed
5 changed files with 330 additions and 201 deletions
14
setup.py
14
setup.py
|
@ -1668,6 +1668,20 @@ class PyBuildExt(build_ext):
|
|||
if '_tkinter' not in [e.name for e in self.extensions]:
|
||||
missing.append('_tkinter')
|
||||
|
||||
# Build the _uuid module if possible
|
||||
uuid_incs = find_file("uuid.h", inc_dirs, ["/usr/include/uuid"])
|
||||
if uuid_incs:
|
||||
if self.compiler.find_library_file(lib_dirs, 'uuid'):
|
||||
uuid_libs = ['uuid']
|
||||
else:
|
||||
uuid_libs = []
|
||||
if uuid_incs:
|
||||
self.extensions.append(Extension('_uuid', ['_uuidmodule.c'],
|
||||
libraries=uuid_libs,
|
||||
include_dirs=uuid_incs))
|
||||
else:
|
||||
missing.append('_uuid')
|
||||
|
||||
## # Uncomment these lines if you want to play with xxmodule.c
|
||||
## ext = Extension('xx', ['xxmodule.c'])
|
||||
## self.extensions.append(ext)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue