zmc
2023-10-12 ed135d79df12a2466b52dae1a82326941211dcc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
U
G=®dVã@sTdZddlZddlmZddlTddlmZddlmZdd„Z    Gd    d
„d
eƒZ
dS) z´distutils.command.build_clib
 
Implements the Distutils 'build_clib' command, to build a C/C++ library
that is included in the module distribution and needed by an extension
module.éN)ÚCommand)Ú*)Úcustomize_compiler)ÚlogcCsddlm}|ƒdS)Nr©Úshow_compilers)Údistutils.ccompilerrr©r    ú_D:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\setuptools/_distutils/command/build_clib.pyrs rc@sleZdZdZdddddgZddgZd    d
d efgZd d „Zdd„Z    dd„Z
dd„Z dd„Z dd„Z dd„Zd
S)Ú
build_clibz/build C/C++ libraries used by Python extensions)z build-clib=Úbz%directory to build C/C++ libraries to)z build-temp=Útz,directory to put temporary build by-products)ÚdebugÚgz"compile with debugging information)ÚforceÚfz2forcibly build everything (ignore file timestamps))z    compiler=Úczspecify the compiler typerrz help-compilerNzlist available compilerscCs:d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)    r Ú
build_tempÚ    librariesÚ include_dirsÚdefineÚundefrrÚcompiler©Úselfr    r    r
Úinitialize_options4szbuild_clib.initialize_optionscCsh| dddddd¡|jj|_|jr0| |j¡|jdkrH|jjpDg|_t|jtƒrd|j tj    ¡|_dS)NÚbuild)rr )rr)rr)rr)rr)
Úset_undefined_optionsÚ distributionrÚcheck_library_listrÚ
isinstanceÚstrÚsplitÚosÚpathseprr    r    r
Úfinalize_optionsDsû
 
 zbuild_clib.finalize_optionscCs¨|js
dSddlm}||j|j|jd|_t|jƒ|jdk    rN|j |j¡|j    dk    rv|j    D]\}}|j 
||¡q^|j dk    r˜|j D]}|j  |¡q†|  |j¡dS)Nr)Ú new_compiler)rÚdry_runr)rrr&rr'rrrZset_include_dirsrZ define_macrorZundefine_macroÚbuild_libraries)rr&ÚnameÚvalueZmacror    r    r
Úrun^s" þ
 
 
 
 
zbuild_clib.runcCs–t|tƒstdƒ‚|D]z}t|tƒs8t|ƒdkr8tdƒ‚|\}}t|tƒsRtdƒ‚d|ksntjdkr~tj|kr~td|dƒ‚t|tƒstdƒ‚qd    S)
a`Ensure that the list of libraries is valid.
 
        `library` is presumably provided as a command option 'libraries'.
        This method checks that it is a list of 2-tuples, where the tuples
        are (library_name, build_info_dict).
 
        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        z+'libraries' option must be a list of tupleséz*each element of 'libraries' must a 2-tuplezNfirst element of each tuple in 'libraries' must be a string (the library name)ú/z;bad library name '%s': may not contain directory separatorsrzMsecond element of each tuple in 'libraries' must be a dictionary (build info)N)    r ÚlistÚDistutilsSetupErrorÚtupleÚlenr!r#ÚsepÚdict)rrÚlibr)Ú
build_infor    r    r
rvs,
 
ÿÿ
ÿÿ
ÿzbuild_clib.check_library_listcCs,|js
dSg}|jD]\}}| |¡q|S)N)rÚappend)rZ    lib_namesÚlib_namer5r    r    r
Úget_library_namesšs  zbuild_clib.get_library_namescCsZ| |j¡g}|jD]>\}}| d¡}|dks>t|ttfƒsJtd|ƒ‚| |¡q|S)NÚsourcesúfin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenames)rrÚgetr r.r0r/Úextend)rÚ    filenamesr7r5r9r    r    r
Úget_source_files¦s 
þÿ zbuild_clib.get_source_filescCs˜|D]Ž\}}| d¡}|dks,t|ttfƒs8td|ƒ‚t|ƒ}t d|¡| d¡}| d¡}|jj||j    |||j
d}|jj |||j |j
dqdS)Nr9r:zbuilding '%s' libraryÚmacrosr)Ú
output_dirr?rr)r@r) r;r r.r0r/rÚinforÚcompilerrZcreate_static_libr )rrr7r5r9r?rZobjectsr    r    r
r(µs, 
þÿ 
 
ü    
þzbuild_clib.build_libraries)Ú__name__Ú
__module__Ú __qualname__Ú descriptionÚ user_optionsÚboolean_optionsrÚ help_optionsrr%r+rr8r>r(r    r    r    r
r s(÷ ÿÿ$ r ) Ú__doc__r#Údistutils.corerÚdistutils.errorsÚdistutils.sysconfigrÚ    distutilsrrr r    r    r    r
Ú<module>s